Reusing UIViewController for modal and non-modal situations
问题 I have a UIViewController — let's call it "FormController" — which is simply a form that edits an object. I want to use it in 2 different situations: Creating a new object — using using UINavigationController's presentModalViewController: method. Editing an existing object — push the view controller onto the UINavigationController stack, not using a dialog method. There is a slight difference in that in the modal situation I would like to have a toolbar with "Cancel" and "Done" buttons,