setTarget:
アクションセルのターゲットオブジェクトをセットします
-(void)setTarget:(id)anObject:
解説
アクションセルのターゲットオブジェクト(anObject)をセットします。
返り値
( void )
なし
引数
( id )anObject
セットするオブジェクト
フレームワーク
ApplicationKit
クラス
NSActionCell
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject1.h" @implementation MyObject1 - (IBAction)myAction:(id)sender { //but1,but2はtextfield //aCellはbutton if ([aCell target]==but1){ [but1 setStringValue:@" "]; [aCell setTarget:but2]; }else{ [but2 setStringValue:@" "]; [aCell setTarget:but1]; } } @end