performSelector:
レシーバーにメッセージを送って、メッセージの結果を返します
-(id)performSelector:(SEL)aSelector
解説
レシーバーにメッセージ(aSelector)を送って、メッセージの結果を返します。
SELはセレクタ。@selector()で表される。
コンパイル時にはエラーとならないので注意。
-Wundeclared-selector オプションをつけてコンパイルする。
@selector( description )
返り値
( id )
オブジェクト
フレームワーク
Foundation
クラス
NSObject
Instance Methods
使用可能
10.0
参照
- performSelector:withObject:
- performSelector:withObject:withObject:
例文
//1 SEL method = (status) ? @selector(show:) : @selector(hide:) ; [self performSelector: method ]; //2 [self performSelector: @selector(description)];