开发者

NSFetchedResultsController.sortDescriptor by KeyPath

开发者 https://www.devze.com 2023-01-09 17:05 出处:网络
How can I set my fetchedResultsController.sortDescriptors to contain a sortdescriptor that uses a keypath, for instan开发者_如何学Cce, such as @\"foo.name\"?

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

精彩评论

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

关注公众号