Int or NSInteger as object for method argument. Objective-C

Posted by sergiobuj on Stack Overflow See other posts from Stack Overflow or by sergiobuj
Published on 2010-03-28T21:25:46Z Indexed on 2010/03/28 21:33 UTC
Read the original article Hit count: 477

Filed under:
|
|

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

int next_int = 1;
[self performSelectorOnMainThread:@selector(meth2:) withObject:next_int waitUntilDone:NO];
//update next_int and call meth2 again

at this point i get a "pointer from integer without a cast" error, and would happen the same with a NSInteger. A NSNumber is not useful because it's immutable and i need to change the value constantly. Any Idea how can i do this?

Thanks.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone