Now we have a list, lets create a detail view for each note. First, create a new view controller (File>New>New File>Cocoa Touch>Objective-C Class) named NoteDetailViewController that is a subclass of UIViewController. Next, drag out a new View Controller in Interface Builder, give it the custom class NoteDetailViewController and add 2 labels and a textview (make sure it is not editable by clicking the appropriate box in the object properties). Open the assistant editor and make sure NoteDetailViewController.m is shown in the right hand frame. Wire up the new storyboard objects by ctrl dragging from each object to the NoteDetailViewController.m and name them titleLabel, dateLabel, and contentView. Finally, create a push manual segue by ctrl dragging from NotesListViewController to NoteDetailViewController and name it listToNote. You should now have the following:

Finally, we just need to get the table view controller to pass the correct note to our detail view controller. Selecting a table row triggers the segue we added in Interface Builder, and also passes the indexPath of the selected cell.

We pass a note to the detail view controller by checking that the destination controller responds to setNote. If it does we use this method with the note found at the indexPath that was passed as sender. We haven’t explicitly defined note setter ‘setNote’ in the target NoteDetailViewController, but it has been generated automatically by Xcode when we synthesized the note instance variable.