I have the following NSTimer call
[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(panelVisibility:)
userInfo:nil
repeats:NO];
-(void)panelVisibility:(BOOL)visible{
...
}
where I need to pass a BOOL value to the panelVisibility method. How do I specify the parameter value?
In this instance, you don’t. Check the reference docs:
So the only parameter your
panelVisibility:method can accept is anNSTimer*, and the timer will pass this in automatically for you.What you can do, however, is use the
userInfofield to pass whatever other information you want. So you could, for instance, do:…and then have: