setTarget:
ターゲットをセットします
-(void)setTarget:(id)target:
解説
ターゲットをセットします。
カラーパネルのカラーを選ぶ・「適用」ボタンをクリックするときにメッセージを送信するターゲットをセットします。
アクションもセットしておかないといけません。
初期設定はnilです。
返り値
( void )
なし
引数
( id )target
ターゲット
フレームワーク
ApplicationKit
クラス
NSColorPanel
Instance Methods
使用可能
10.0
参照
- setAction:
- setContinuous:
例文
#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