indexOfItemWithObjectValue:
オブジェクトをコンボボックスから探してその位置を返します
-(int)indexOfItemWithObjectValue:(id)anObject:
解説
オブジェクトをコンボボックスから探してその位置(0ベースの整数)を返します。
同じかどうかの判断は、●同じIDを持つ、●isEqualである。
同じものがなければNSNotFoundを返します。
返り値
( int )
整数値
引数
( id )anObject
フレームワーク
ApplicationKit
クラス
NSComboBox
Instance Methods
使用可能
10.0
参照
- selectItemWithObjectValue:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSLog([NSString stringWithFormat:@"%d",[myOutlet indexOfItemWithObjectValue:@"sann"]]); } @end