Homework

Using the Navigation project you already have, add a textViewController to it.

1. Put another element in the table view and title it "textEdit" or something similar.

2. In didSelectRowAtIndexPath in the table view controller, push the view controller onto the navigation stack,

[self.navigationController pushViewController:textViewController animated:YES];

3. Take the TextViewController .h and .m files from the sample code and copy them into your project. Be sure the .m file is in the Build Settings list of files to be compiled.

4. In the table view controller "vieweDidLoad" method, initialize the text view controller,

textViewController = [[TextViewController alloc] initWithNibName:nil bundle:nil];

5. Try it. On ending the edit session, the content of the text view will be logged to the console.

 

Notice that the textViewDidBeginEditing installs a "Done" button in the navigation header. This doesn't appear when the sample code is run. It belongs to the text view controller but must be installed by the navigation controller, which does not exist in the sample code.