macOS/iOS API解説

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

目次

sendAction:to:from:

【重複 削除予定

ターゲットにメッセージを送信します
-(BOOL)sendAction:(SEL)anAction
      to:(id)aTarget
      from:(id)sender

解説

ターゲット(aTarget)にメッセージ(anAction)を送信します。

返り値

( BOOL )

YES/NO

引数

( SEL )anAction

セレクタ

( id )aTarget

ターゲット

( id )sender

送信者

フレームワーク

ApplicationKit

クラス

NSApplication

Instance Methods

使用可能

10.0

参照

- targetForAction:
- tryToPerform:with:
- makeWindowsPerform:inOrder:

例文

#import "Controller.h"

@implementation Controller

- (IBAction)pushButton:(id)sender
{
	[NSApp sendAction:@selector(theAction:)
				   to:self
				 from:sender
	 ];
}
-(void)theAction:(id)sender
{
	NSLog([sender className]);
}


@end