I\'m having some trouble passing a number as an argument for a method:
- (void)meth2:(int)next_int;
And to call that method I need this:
<
Wrap the integer in an NSNumber before passing it:
int next_int = 1
NSNumber *theNumber = [NSNumber numberWithInt:next_int];
[self performSelectorOnMainThread:@selector(meth2:) withObject:theNumber waitUntilDone:NO];
Then your -meth2: method could look something like this:
- (void)meth2:(NSNumber*)theNumber
{
int next_int = [theNumber intValue];
// do whatever
}