selectionIndexPaths
レシーバーの現在の選択されたオブジェクトのインデックスパスを含む配列を返します
解説
レシーバーの現在の選択されたオブジェクトのインデックスパスを含む配列を返します。
返り値
( NSArray * )
なし
引数
フレームワーク
ApplicationKit
クラス
NSTreeController
Instance Methods
使用可能
10.4
参照
-selectionIndexPath
例文
#import "MyObject.h" // IBOutlet NSTreeController* myTreeController; @implementation MyObject -(void)awakeFromNib { //挿入するオブジェクトを作る NSDictionary *dic1 = [NSDictionary dictionaryWithObject:@"aaaa" forKey:@"newKey"]; NSDictionary *dic2 = [NSDictionary dictionaryWithObject:@"bbbb" forKey:@"newKey"]; NSDictionary *dic3 = [NSDictionary dictionaryWithObject:@"cccc" forKey:@"newKey"]; NSDictionary *dic4 = [NSDictionary dictionaryWithObject:@"dddd" forKey:@"newKey"]; NSDictionary *dic5 = [NSDictionary dictionaryWithObject:@"eeee" forKey:@"newKey"]; NSDictionary *dic6 = [NSDictionary dictionaryWithObject:@"ffff" forKey:@"newKey"]; NSArray *objects = [NSArray arrayWithObjects:dic1,dic2,dic3,dic4,dic5,dic6,nil]; //挿入する場所キーパスを作る NSIndexPath *path1 = [NSIndexPath indexPathWithIndex:0]; NSIndexPath *path2 = [NSIndexPath indexPathWithIndex:1]; NSIndexPath *path3 = [NSIndexPath indexPathWithIndex:2]; NSIndexPath *path4 = [NSIndexPath indexPathWithIndex:3]; NSIndexPath *path5 = [NSIndexPath indexPathWithIndex:4]; NSIndexPath *path6 = [NSIndexPath indexPathWithIndex:5]; NSArray *indexPaths = [NSArray arrayWithObjects:path1,path2,path3,path4,path5,path6,nil]; //挿入する [myTreeController insertObjects:objects atArrangedObjectIndexPaths:indexPaths]; } - (IBAction)myAction:(id)sender { NSLog(@"selectionIndexPaths = %@",[[myTreeController selectionIndexPaths] description]); } @end