- (BOOL)connectionRoom:(BOOL)isReconncet:{
}
原因:
withObject参数传nil才是NO
传任何其他参数代表YES
以下是stackoverflow给出的相关解释:
The simplest way is as follows:
If you have method
-(void)doSomething:(BOOL)flag
and want to performSelecor with flag=NO use
[object performSelector:@selector(doSomething:) withObject:nil];
In case of flag=YES you can send any object, for example, @YES - number from bool
[object performSelector:@selector(doSomething:) withObject:@YES];
Note: don't use @NO ! Only nil will be interpreted as NO in your method with bool argument.
原文 https://stackoverflow.com/questions/7075620/iphone-performselector-with-bool-parameter
网友评论