Objective-C NSMethodSignature issue!
Basically I'm using "instanceMethodSignatureForSelector" as part of the construction of an NSTimer. My problem is that the below NSMethodSignature is always set to "Nil".
NSMethodSignature *s开发者_开发百科ignature = [[self class] instanceMethodSignatureForSelector:@selector(gravityMeth:sprite:)];
The selector that it's looking at is the below.
-(void) gravityMeth:(CCSprite*)sprite:(b2Body*)body
Does anyone have any help because I honestly can't see the problem at all!
Thanks in advance!
-(void) gravityMeth:(CCSprite*)sprite:(b2Body*)body
That selector is gravityMeth::
, not gravityMeth:sprite:
.
Try:
-(void) gravityMeth:(CCSprite*)sprite body:(b2Body*)body
Which would yield a selector of gravityMeth:body:
(which would be somewhat more descriptive -- better still would be something like applyGravitySprite:withBody:
).
精彩评论