I know to send a parameter to a selector, we use withObject
, but how to handle the following case:
UIBarButtonItem* backButton = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:[[NavigatorUtil new] autorelease] action:@selector(back:) ];
The back method looks like:
#import "NavigationUtil.h"
@implementation NavigationUtil
+(void) back: (UINavigationController*) navigationController
{
[navigationController popViewControllerAnimated:YES];
}
@end
Now I need to send a parameter to this selector? How to?