开发者

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:).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜