0

NSScrollViewでバインドされているを持っていArrayControllerます。コンテンツをアルファベット順に並べ替える必要があります。バインディングでこれを実行しようとしましたが、バインドする適切なものが見つかりません。sortDescriptor私は自分で以下を使用しましたArrayController

[myArrayController setSortDescriptors:[NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"myKey" ascending:YES selector:@selector(compare:)]]];

プロセスのステップを見逃しているのでしょうか、それともコンテンツの分類に近づいていないのでしょうか?

4

1 に答える 1

0

FilterPredicateを試しましたか?これはサンプルコードです:

NSDate *afterDate=[balanceDateAfter objectValue];
NSDate *beforeDate=[balanceDateBefore  objectValue];
NSComparisonResult duration=[beforeDate timeIntervalSinceDate:afterDate];

duration=duration/3600;
duration=duration/24;

[checkInBalanceArray setFilterPredicate:[NSPredicate predicateWithFormat:@"(checkDate >= %@) AND (checkDate <= %@)", afterDate, beforeDate]];

[checkOutBalanceArray setFilterPredicate:[NSPredicate predicateWithFormat:@"(checkDate >= %@) AND (checkDate <= %@)", afterDate, beforeDate]];
于 2013-01-10T08:25:20.243 に答える