Hey, I am trying to add a selector to a button in my navigationbar programmatically and I can't seem to find out why it doesn't work at all. Here is the code I got:
[self.navigationController.navigationItem.rightBarButtonItem setAction:@selector(showWithLabel)];
Am I doing this correctly and is there anything else I should do?
EDIT: I found out that the button was nil, I don't understand as it is connected to rightBarButton outlet.
EDIT(Again): I found out that the navigationitem is nil, any idea where is the problem then?
[self.navigationItem.rightBarButtonItem ...?