0

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 *signature = [[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!

Jeff
  • 2,017
  • 3
  • 15
  • 8

1 Answers1

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

bbum
  • 162,346
  • 23
  • 271
  • 359