I have a problem with performSelector. It works if I call a method without parameters, but it doesn't even call a method if I pass a parameter.
Example:
- (void)test
{
NSLog(@"test");
}
...
[self performSelector:@selector(test) withObject:nil afterDelay:1.0];
- (void)switchOn:(NSNumber *) index
{
NSLog(@"switchOn");
}
....
NSLog(@"int is %d", [((NSNumber *)obj) intValue]);
[self performSelector:@selector(switchOn:) withObject:obj afterDelay:1.0];
I also do not get errors. Where can this be a problem?
thank
source
share