Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Hour 16. Using Split Views on iPad > Implementing the Second Interface

Implementing the Second Interface

Whether your second interface is for iPhone or iPad, the implementation task is different from the first task. Hour 15 explained how to add interface elements from the library and how to control-drag to create their properties. That works for the first interface. For the second interface, you can omit the second step because you already have the properties in your header files (and the synthesize directives in your implementation files). For the second interface, you create the interface elements and just connect them to the existing properties.

Try It Yourself: Adding a Field to the Second Interface

Implementing your second interface is simpler than the first one. It is just a matter of adding interface objects and connecting them.

1.
Open DetailViewController.h, as shown in Figure 16.3. You will see the properties you added in the first interface (customer and address).

Figure 16.3. Review properties and connections.


2.
The round circle in the gutter indicates that the properties are connected to interface elements. Click on one of them and you will see the object to which it is connected.

3.
Click on the round circle and you will go to the connected object in the interface file, as shown in Figure 16.4. Note that this will be in the iPhone nib file if you have followed these steps.

Figure 16.4. Look at the connected object.


4.
Open the other detail nib file (DetailViewController_iPad.xib, in this case). If necessary, delete the label for the detail content. You do not have to delete the property and synthesize statement because that was done when you deleted the label for the iPhone nib file.

5.
Drag a text field from the library, as shown in Figure 16.5. Arrange and size it as you wish. Remember that you are now working on an iPad canvas so you have plenty of room. As part of the creation process, remember to name the field.

Figure 16.5. Add a text field to the iPad interface.


6.
Control-drag from File’s Owner to the new text field and connect the name property, as shown in Figure 16.6.

Figure 16.6. Connect the property in File’s Owner to the Name field.


7.
Verify that both connections have been made. Look in DetailViewController.h, as shown in Figure 16.7, to see that both nib files are connected to the controller.



Figure 16.7. Verify the connections.




  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial