0

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"]]; 
}
unicorn22
  • 21
  • 3
  • Is the `addButtonPressed:` method getting called? Can you set a break point there? What code have you implemented for that method? – picciano Feb 21 '12 at 18:07
  • It's not getting called. I have a breakpoint set that's not getting hit (and unfortnately, I can't find the code that is getting called). Method is above. – unicorn22 Feb 22 '12 at 04:03
  • The solution to this issue is at http://stackoverflow.com/questions/7788780/uipageviewcontroller-gesture-recognizers. – unicorn22 Feb 26 '12 at 02:13

0 Answers0