title: How To Match NSUserDefaults and CoreData Attribute and Get Data if both are same
body: <p>Here i have an entity named ClipTable i am fetching all clip related information of all users here but i want to fetch clip information with particular user who is logged in,for that i have stored his user_id using NSUserDefaults. And my clip table has a attribute named created_by_user, which is basically a userid of a particular user who stores the clip. So using this created_by_user attribute and user_id from NSUserDefaults i want to check whether both are same. And if both are same get the clip record  of that particular user only. below is the code with which i am only able to show all the clip record of all the user in tableView using NSFetchResultController. But now i want to get records for the particular user only. Hard time doing this. Any help is appreciated.</p>
  
  <p>user_id is [NSUserDefaults standardUserDefaults] stringForKey:@"userID"]</p>
  
  <pre><code>-(void)fetch:(NSString*)catgeory :(BOOL)All{
  
  AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
  self.managedObjectContext = delegate.managedObjectContext;
  NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:@"ClipTable"];
  
  // Add Sort Descriptors
  [fetchRequest setSortDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"modifieddate" ascending:NO]]];
  
  //_fetchedResultsController=nil;
  // Initialize Fetched Results Controller
  self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
  
  if (All==NO) {
      [fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"(page_categorisation == %@)",catgeory]];
  }
  
  [fetchRequest setFetchBatchSize:0];
  //  [fetchRequest setFetchLimit:10];
  // Configure Fetched Results Controller
  [self.fetchedResultsController setDelegate:self];
  
  // Perform Fetch
  NSError *error = nil;
  [self.fetchedResultsController performFetch:&amp;error];
  
  if (error) {
      NSLog(@"Unable to perform fetch.");
      NSLog(@"%@, %@", error, error.localizedDescription);
  }
  }
  </code></pre>