setAction:
アクションセルにアクションセレクタをセットします
-(void)setAction:(SEL)aSelector:
解説
アクションセルにアクションセレクタ(aSelector)をセットします。
返り値
( void )
なし
フレームワーク
ApplicationKit
クラス
NSActionCell
Instance Methods
使用可能
10.0
参照
例文
#import "MyObject.h" @implementation MyObject - (IBAction)action1:(id)sender { if ([sender action] == @selector(action1:)){ NSLog(@"action1"); [sender setAction:@selector(action2:)]; } } - (IBAction)action2:(id)sender { if ([sender action] == @selector(action2:)){ NSLog(@"action2"); [sender setAction:@selector(action3:)]; } } - (IBAction)action3:(id)sender { if ([sender action] == @selector(action3:)){ NSLog(@"action3"); [sender setAction:@selector(action1:)]; } } @end