macOS/iOS API解説

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

目次

setSortDescriptorPrototype:

ソートデスクリプタのプロトタイプをセットします
-(void)setSortDescriptorPrototype:(NSSortDescriptor *)sortDescriptor:

解説

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

返り値

( void )

なし

引数

( NSSortDescriptor * )sortDescriptor

フレームワーク

ApplicationKit

クラス

NSTableColumn

Instance Methods

使用可能

10.3

参照

-sortDescriptorPrototype

例文

//ソートデスクリプタ
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];        
NSLog(@"sortDescriptors %@",[[myOutlet sortDescriptors] description]);