I can add a Cancel or Done button to a UINavigationBar in Interface Builder. But how do I hook these up to action methods so I can close the modal view controller or save the input and then close it?
The connections panel doesn’t show any action methods for a UIBarButtonItem.
I would do this in code, in the viewDidLoad or awakeFromNib methods. First, you need to create the button, and add a method to be called when the buttons are pushed.
Alternatively, in IB, make your IBAction method,
and declare it in your Class.h,
Then in IB, right click on the Button and drag from ‘Selector’ to your file’s owner (the view controller) and select the doneButtonPressed: method.