I've got a page-based iPhone application with a UINavigationBar as part of the RootViewController. I'd like to add a plus button to the right hand side of the nav bar.
When I add the Bar Button Item in storyboard, it is automatically set as the the rightBarButtonItem for the Navigation Item.
I wire up the sent action in storyboard to my RootViewController that contains an IBAction called addButtonPressed.
However, when I click on the button, the (I assume) default behavior of navigating to the next page is called instead of my addButtonPressed method. How do I prevent this default behavior?
Here's the method implementation:
- (IBAction) addButtonPressed:(id) sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.apple.com"]];
}