I work on an app that heavily relies on table views with NSFetchedResultsController.
I've found that on users' devices, the app lags. On the kind of large data set that some of our users have on their devices, Instruments showed that `tableView:heightForRowAtIndexPath:` was the biggest culprit (in it, we check the value of a property and return a different height based on that). According to Instruments, this process led to faults being fired constantly.
I'm trying to avoid this, I tried to use `returnsObjectsAsFaults = NO`, but that did nothing. Objects are still returned as faults. I'm guessing this is a bug, and I found references to it from years ago on Stack Overflow.
That was the first issue.
The second issue is that if I Cmd-click into the documentation for `NSFetchedRequest`, the comments on the `propertiesToFetch` property state the following:
"Specifies a collection of either NSPropertyDescriptions or NSString property names that should be fetched. The collection may represent attributes, to-one relationships, or NSExpressionDescription. If NSDictionaryResultType is set, the results of the fetch will be dictionaries containing key/value pairs where the key is the name of the specified property description. If NSManagedObjectResultType is set, then NSExpressionDescription cannot be used, and the results are managed object faults partially pre-populated with the named properties"
I tried it and this is indeed the behaviour. By adding the property that determines my table view row heights, I can avoid the fault firing. However, the actual documentation states:
"This value is only used if
resultType is set to NSDictionaryResultType."This is not the case.
These two issues seem like bugs to me. But I'm posting this because Core Data is like quantum mechanics - anyone who says they know it, doesn't know it - and I'm wondering if I'm missing something here.