Yes, you can...
pay attention to the method
- (NSFetchedResultsController *)fetchedResultsController;
and add the following lines there (in this example we get only a separate "title" attribute of our managed objects):
[fetchRequest setReturnsDistinctResults:YES]; [fetchRequest setResultType:NSDictionaryResultType]; [fetchRequest setPropertiesToFetch:[NSArray arrayWithObject:@"title"]]; self.fetchedResultsController.delegate = nil;
you need to take care of how you access the values ββfrom NSFetchedResultsController ... For example, in
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
use the following code to access the data:
NSDictionary* title = [self.fetchedResultsController objectAtIndexPath:indexPath]; cell.textLabel.text = [title objectForKey:@"title"];
source share