是否可以使用此方法并传递一个对象?使用此代码,我收到此错误:
-[myApp hideUpdateView]: unrecognized selector sent to instance 0x8b6a880
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[myApp hideUpdateView]: unrecognized selector sent to instance 0x8b6a880'
它永远不会到达 hideUpdateView 方法......
代码:
NSArray *array = [NSArray arrayWithObjects:@"1", @"2", nil];
[self performSelector:@selector(hideUpdateView) onThread:[NSThread mainThread] withObject:array waitUntilDone:YES];
- (void) hideUpdateView: (NSArray *) inputArray
{
int catCount = [[inputArray objectAtIndex:0] intValue];
//hide it
}