Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Data with A-Z sections
    primarykey
    data
    text
    <p>I am trying to add an A-Z index for a core-data populated table using the example here: <a href="http://blog.sallarp.com/iphone-core-data-uitableview-drill-down/" rel="nofollow noreferrer">http://blog.sallarp.com/iphone-core-data-uitableview-drill-down/</a></p> <p>However, I can't work out where I can set my sectionNameKeyPath property in the core data helper header file: </p> <p>Do I need to make a NSFetchedResultsController like they do in CoreDataBooks? Or can I just add it in somewhere here?! Sorry for the ignorance, any thoughts / help would be much appreciated (this is day 3 of tearing my hair out over it). </p> <pre><code>+(NSMutableArray *) searchObjectsInContext: (NSString*) entityName : (NSPredicate *) predicate : (NSString*) sortKey : (BOOL) sortAscending : (NSManagedObjectContext *) managedObjectContext { NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:entityName inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; // If a predicate was passed, pass it to the query if(predicate != nil) { [request setPredicate:predicate]; } // If a sort key was passed, use it for sorting. if(sortKey != nil) { NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:sortKey ascending:sortAscending]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [sortDescriptors release]; [sortDescriptor release]; } NSError *error; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&amp;error] mutableCopy]; [request release]; return mutableFetchResults; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload