But you can use selectors with parameters! NSObjecthas three methods defined as follows:
-performSelector:
-performSelector:withObject:
-performSelector:withObject:withObject:
Now the first is similar to @selector(someMethod:), but the last two are used to send parameters to the selector. For example:
-(void)sendToVolume:(NSNumber)nr {
}
then you can use it as follows:
[appController performSelector:@selector(sendToVolume:)
withObject:[NSNumber numberWithInt:1]]
Woofy source
share