Changes

Jump to: navigation, search
Creating the NIB File for the Second Table View
Double click on ''BooksViewController.xib'' in the main project window to load it into Interface Builder. The file currently contains a UIView object when we actually want it to contain a UITableView. In the ''BooksViewController.xib'' document window select the ''View'' icon and press the Delete key on the keyboard to remove it from the file. From the Library window (''Tools -> Library'' or Command + L) drag a Table View object into the document window. The design window will subsequently update to reflect the presence of the table view, populating it with some dummy data:
 
[[Image:second_tableview_added.jpg|The second table view object added to our example iPhone app]]
 
 
Select the File’s Owner icon, display the Identity Inspector and change the class to BooksViewController. With the File’s Owner item still selected, display the Connections Inspector (''Tools -> Connections Inspector'' or Command + 2). Click on the circle to the right of the view outlet and drag to the Table View entry in the document window. Select the Table View object and using the same technique, connect the ''dataSource'' and ''delegate'' outlets to ''File’s Owner''. Save and exit from Interface Builder.

Navigation menu