Adding names to the Table View
To add more names to the table view, we need to add a View Controller class that displays a navigation bar with two items: Save and Cancel. This View Controller class also displays a View that prompts the user to enter a name to be added. We also need to add code to the RootView controller implementation file, so that when the user selects the Save button after entering the new name, it's added to the Table View for display.
The sequence is as follows:
1. Add a View Controller class called
AddNameController
.2. Define a protocol, outlets, and action methods in the
AddNameController.h
header file.3. Define the View of the
AddNameController
class and the connecting controls.4. Add code to the
AddNameController.m
implementation file to invoke delegate methods.5. Invoke the newly added AddNameController View and implement the protocol methods.
6. Place a Bar Button Item Control in the RootViewController and connect it.