methodSignatureForSelector:
フレームワーク
Foundation
クラス
NSObject
Instance Methods
使用可能
10.0
参照
+ instanceMethodSignatureForSelector:
- forwardInvocation:
例文
#import "MyObject.h" @implementation MyObject NSTimer *timer=nil; - (IBAction)myAction:(id)sender { id aSignature ;//シグネチャ id invocation ;//起動オブジェクト SEL aSelector ;//アクションセレクタ aSelector = @selector( timerControl );//アクションセレクタをセット aSignature = [ self methodSignatureForSelector:aSelector ];//セレクタのシグネチャをセット invocation = [ NSInvocation invocationWithMethodSignature:aSignature ];//起動オブジェクトをセット [ invocation setTarget: self ];//ターゲットはself [ invocation setSelector: aSelector ];//セレクタをセット [ invocation invoke ];//起動する NSLog([NSString stringWithFormat:@"%d",[[invocation methodSignature] numberOfArguments]]); } -(void) timerControl{ NSLog(@"..."); } @end