【发布时间】:2013-01-08 13:29:35
【问题描述】:
我刚刚开始使用MagicalRecord library,以便更轻松地使用 CoreData。我正在使用 FRC,但不知道如何使用自定义 sortDescriptor 进行设置,例如
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc]
initWithKey:@"someAttribute"
ascending:YES
selector:@selector(localizedCaseInsensitiveCompare:)];
目前我检索 FRC 的电话是这样的:
_fetchedResultsController = [Language MR_fetchAllSortedBy:@"someAttribute"
ascending:YES
withPredicate:nil
groupBy:nil
delegate:self];
似乎我正在寻找一种“简单”地将自定义选择器添加到 MR_fetchAllSortedBy 的方法。比如:
_fetchedResultsController =
[Language MR_fetchAllSortedBy:@"someAttribute"
ascending:YES
selector:@selector(localizedCaseInsensitiveCompare:)
withPredicate:nil
groupBy:nil
delegate:self];
谁能给我一些关于如何实现这一目标的指示?可以使用类别吗?
提前致谢,
乔斯。
【问题讨论】:
标签: objective-c ios core-data magicalrecord