NSFetchedResultsController.sortDescriptor by KeyPath
How can I set my fetchedResultsController.sortDescriptors
to contain a sortdescriptor that uses a keypath, for instan开发者_如何学Cce, such as @"foo.name"
?
Cheers
Nik
Despite NSSortDescriptor
's use of the name “key”, it actually takes a key path, as described in the documentation. So, just create an NSSortDescriptor
with your key path as the “key”, and use that.
精彩评论