NSFetchedResultsController Doesn't Respect Return Type of NSFetchRequest
| Originator: | craig | ||
| Number: | rdar://21791991 | Date Originated: | 13-Jul-2015 01:32 PM |
| Status: | Open | Resolved: | |
| Product: | iPhone/iPod touch | Product Version: | 3.1 |
| Classification: | Serious Bug | Reproducible: | Always |
This is a duplicate of rdar://7274887 Summary: The objects returned by -[NSFetchedResultsController objectAtIndexPath:] and -[NSFetchedResultsController fetchedObjects] are full NSManagedObjects even if the resultType of the NSFetchRequest used by the NSFetchedResultsController is set to be NSManagedObjectIDResultType or NSDictionaryResultType. Steps to Reproduce: 1. Create a Navigation-based Application from the iphone templates and check the box for using Core Data. 2. Insert the line "[fetchRequest setResultType:NSDictionaryResultType];" on line 206 of RootViewController.m 3. Insert the line "NSLog(@"%@", [fetchedResultsController objectAtIndexPath:indexPath]);" between 129 and 130 of the same file. 4. Build and Debug the application. 5. Tap the + button. Expected Results: The line printed to the debugger should be a typical NSLog from an NSDictionary. Actual Results: The line printed shows it's an NSManagedObject. Regression: Values that existed before the current run and loaded from the data store are actual NSDictionaries while the values added at runtime are NSManagedObjects.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!