iphone Programming Glossary: sortdescriptor
Core Data backed UITableView with indexing http://stackoverflow.com/questions/1599204/core-data-backed-uitableview-with-indexing You can specify the section key in the fetch request I think it has to match the first sort key NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ name this key defines the sort ascending YES NSArray sortDescriptors NSArray alloc.. sortDescriptor NSSortDescriptor alloc initWithKey @ name this key defines the sort ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil fetchRequest setSortDescriptors sortDescriptors NSFetchedResultsController.. alloc initWithKey @ name this key defines the sort ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil fetchRequest setSortDescriptors sortDescriptors NSFetchedResultsController aFetchedResultsController NSFetchedResultsController..
iPhone CoreData - How to fetch managed objects, and sorting them ignoring case? http://stackoverflow.com/questions/2013158/iphone-coredata-how-to-fetch-managed-objects-and-sorting-them-ignoring-case Class reference and I could find the answer for my question. The solution is setting a selector the the sortDescriptor as follow NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ firstName ascending YES selector @selector.. find the answer for my question. The solution is setting a selector the the sortDescriptor as follow NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ firstName ascending YES selector @selector caseInsensitiveCompare I hope it will be..
Core Data Table View Section Sort by weekdays using NSSortDescriptor http://stackoverflow.com/questions/2168141/core-data-table-view-section-sort-by-weekdays-using-nssortdescriptor like this Which sorts alphabetically then by time NSString sectionKey nil switch tab case kByWeekA NSSortDescriptor sortDescriptor1 NSSortDescriptor alloc initWithKey @ day ascending NO NSSortDescriptor sortDescriptor2 NSSortDescriptor alloc initWithKey.. case kByWeekA NSSortDescriptor sortDescriptor1 NSSortDescriptor alloc initWithKey @ day ascending NO NSSortDescriptor sortDescriptor2 NSSortDescriptor alloc initWithKey @ starttime ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor1.. day ascending NO NSSortDescriptor sortDescriptor2 NSSortDescriptor alloc initWithKey @ starttime ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor1 sortDescriptor2 nil fetchRequest setSortDescriptors sortDescriptors sortDescriptor1..
UITableView Core Data reordering http://stackoverflow.com/questions/2360938/uitableview-core-data-reordering entityForName @ RowObj inManagedObjectContext self managedObjectContext request setEntity entity NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ displayOrder ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor.. entity NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ displayOrder ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil request setSortDescriptors sortDescriptors sortDescriptors release sortDescriptor.. NSSortDescriptor alloc initWithKey @ displayOrder ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil request setSortDescriptors sortDescriptors sortDescriptors release sortDescriptor release NSError error NSMutableArray..
iPhone SDK Core Data: Fetch all entities with a nil relationship? http://stackoverflow.com/questions/2745994/iphone-sdk-core-data-fetch-all-entities-with-a-nil-relationship predicate NSPredicate predicateWithFormat @ author nil fetchRequest setPredicate predicate NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ name ascending NO NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor.. setPredicate predicate NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ name ascending NO NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil fetchRequest setSortDescriptors sortDescriptors NSString sectionKey @.. NSSortDescriptor alloc initWithKey @ name ascending NO NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil fetchRequest setSortDescriptors sortDescriptors NSString sectionKey @ name nil NSFetchedResultsController aFetchedResultsController..
NSFetchedResultsController refresh refetch? http://stackoverflow.com/questions/3399012/nsfetchedresultscontroller-refresh-refetch entityForName @ Favorite inManagedObjectContext managedObjectContext NSString sectionKey @ favname NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ favname ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor.. @ favname NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ favname ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil if showAll NO if isXSelected NO NSPredicate predicate NSPredicate predicateWithFormat.. NSSortDescriptor alloc initWithKey @ favname ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil if showAll NO if isXSelected NO NSPredicate predicate NSPredicate predicateWithFormat @ isFirst TRUE fetchRequest setPredicate..
NSFetchedResultsController custom sort not getting called http://stackoverflow.com/questions/4789782/nsfetchedresultscontroller-custom-sort-not-getting-called setEntity entity Set the batch size to a suitable number. fetchRequest setFetchBatchSize 20 NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey @ objectName ascending YES comparator ^ id s1 id s2 NSLog @ Comparator custom compare.. ^ id s1 id s2 NSLog @ Comparator custom compare here with print statement NSLog @ Sort Descriptor Set NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil NSEntityDescription entity NSEntityDescription entityForName @ Object.. compare here with print statement NSLog @ Sort Descriptor Set NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil NSEntityDescription entity NSEntityDescription entityForName @ Object inManagedObjectContext self.managedObjectContext..
Distinct Count via Core Data, NSExpression Into NSFetchedResultsController http://stackoverflow.com/questions/9157436/distinct-count-via-core-data-nsexpression-into-nsfetchedresultscontroller fetchRequest setPropertiesToFetch propertiesToFetch fetchRequest setFetchBatchSize 20 NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey strFieldName ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor.. 20 NSSortDescriptor sortDescriptor NSSortDescriptor alloc initWithKey strFieldName ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil fetchRequest setSortDescriptors sortDescriptors NSFetchedResultsController.. NSSortDescriptor alloc initWithKey strFieldName ascending YES NSArray sortDescriptors NSArray alloc initWithObjects sortDescriptor nil fetchRequest setSortDescriptors sortDescriptors NSFetchedResultsController aFetchedResultsController NSFetchedResultsController..
|