CoreData の操作を簡単にするために、 MagicalRecord ライブラリの使用を開始しました。FRC を使用していますが、次のようなカスタム sortDescriptor を使用して FRC を設定する方法がわかりません。
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];
これを達成する方法について、誰かが私にいくつかの指針を教えてもらえますか? 多分カテゴリを使用して?
前もって感謝します、
ジョス。