macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setTarget:

ターゲットオブジェクトをセットします
-(void)setTarget:(id)anObject:

解説

ターゲットオブジェクトをセットします。

返り値

( void )

なし

引数

( id )anObject

フレームワーク

ApplicationKit

クラス

NSControl

Instance Methods

使用可能

10.1

参照

- action
- setAction:
- target
- setTarget:(NSCell)

例文

#import "OtherAction.h"

@implementation OtherAction

- (IBAction)myAction:(id)sender
{
[sender setTarget:switchClass];
NSLog([[sender target] className]);//senderはボタン
}

@end