Hi
When using the dataFetchOptions to sort a section...
self.tableModel.dataFetchOptions.sort = YES;
UA-17470720-3
Posted 09 August 2016 - 09:48 PM
Hi
When using the dataFetchOptions to sort a section...
self.tableModel.dataFetchOptions.sort = YES;
Posted 10 August 2016 - 10:06 AM
Hi Dennis,
The current way to further customize sorting, other than implementing 'didFetchItemsFromStore', is to subclass your relevant data fetch options class and provide your own custom 'sortDescriptors' method override. For instance, if you're working with SCCoreDataFetchOptions:
@interface MyFetchOptions : SCCoreDataFetchOptions @end @implementation MyFetchOptions - (NSArray *)sortDescriptors { return myCustomDescriptors; } @end ... // later in your ViewController ... SCCoreDataFetchOptions *oldOptions = myArrayOfObjectsSection.dataFetchOptions; MyFetchOptions *myFetchOptions = [MyFetchOptions optionsWithSortKey:oldOptions.sortKey sortAscending:YES filterPredicate:nil]; myFetchOptions.orderAttributeName = oldOptions.orderAttributeName; // only required if you're setting 'orderAttributeName' myArrayOfObjectsSection.dataFetchOptions = myFetchOptions;
Edited by Tarek, 10 August 2016 - 10:09 AM.
Fixed typo
Posted 25 September 2016 - 11:24 AM
Many, thanks. Will try that (somehow missed your reply).
Edit: That took 5 minutes and works perfectly!
Dennis
Edited by Dennis, 25 September 2016 - 11:39 AM.
0 members, 0 guests, 0 anonymous users