开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜