I have this code:
UIBarButtonItem *donebutton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(doneButtonPressed:)];
self.navigationItem.rightBarButtonItem = donebutton;
Now I want to pass some argument to the method :
- (void)doneButtonPressed{}
How to do that ?
Use setAssociatedObject for this if u want to pass object say string then:
Firstly add
Now
and retrieve like this where ever u want your arguments:
But if u want button reference then