setAction:
アクションメッセージをセットします
-(void)setAction:(SEL)action:
解説
アクションメッセージをセットします。
カラーパネルのカラーを選ぶ・「適用」ボタンをクリックするときに呼び出すアクションをセットします。
ターゲットもセットしておかないといけません。
初期設定はnilです。
返り値
( void )
なし
フレームワーク
ApplicationKit
クラス
NSColorPanel
Instance Methods
使用可能
10.0
参照
- setTarget:
例文
#import "Controller.h" @implementation Controller NSColorPanel *cPanel; - (IBAction)pushButton:(id)sender { cPanel = [NSColorPanel sharedColorPanel]; [cPanel setTarget:self]; [cPanel setAction:@selector(tekiyou:)]; [[NSApplication sharedApplication] orderFrontColorPanel:cPanel]; } -(void)tekiyou:(id)sender { NSLog(@"!!!"); } @end