I started reading up about the NSFetchedResultsController today, but I’ve come across some confusing syntax, can someone please describe what the following two lines mean? Specifically the id <something>
id <NSFetchedResultsSectionInfo> sectionInfo = [[fetchedResultsController sections] objectAtIndex:section];
and
NSManagedObjectContext *context = <#Managed object context#>;
Also, please confirm my understanding that the NSFetchedResultsController is simply a kind of NSMutableArray but with additional functionality (delegate messages) specifically for controlling Core Data?
id<PROTO> foodeclares a variablefoowhose type is “pointer to object conforming to protocol PROTO”. This means that it is only okay to send the messages in thePROTOprotocol tofoo.<#Managed Object Context#>is not valid Objective-C syntax. It’s just saying, “stick the code to get a reference to your MOC here.”NSFetchedResultsControlleris not related toNSMutableArray. The only thing they have in common is that both provide access to ordered collections.NSFetchedResultsControllerstands between you and managed object context. Its content is determined by what is in the context and the fetch request supplied when the fetched results controller is created. It mediates access to the MOC and uses cached data whenever possible. Its intended use is as an easy way to get data from Core Data into aUITableView.