macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setSortDescriptors:

ソートデスクリプタをセットします
-(void)setSortDescriptors:(NSArray *)sortDescriptors:

解説

ソートデスクリプタをセットします。

返り値

( void )

なし

引数

( NSArray * )sortDescriptors

ソートデスクリプタの配列

フレームワーク

ApplicationKit

クラス

NSArrayController

Instance Methods

使用可能

10.3

参照

-sortDescriptors

例文

//ソートデスクリプタ
NSMutableArray *descriptors=[NSMutableArray arrayWithCapacity:0];
NSSortDescriptor *descriptor;

        descriptor=[[NSSortDescriptor alloc] initWithKey:@"sort1" ascending:YES selector:@selector(compare:)];
        [[tableView tableColumnWithIdentifier:@"newKey"] setSortDescriptorPrototype:descriptor];
        [descriptors addObject:descriptor];
        [descriptor release];

        descriptor=[[NSSortDescriptor alloc] initWithKey:@"sort2" ascending:YES selector:@selector(compare:)];
        [[tableView tableColumnWithIdentifier:@"newKey2"] setSortDescriptorPrototype:descriptor];
        [descriptors addObject:descriptor];
        [descriptor release];
[myOutlet setSortDescriptors:descriptors];