Graphics Programs Reference
In-Depth Information
#import "DetailViewController.h"
@implementation DetailViewController
@end
In Homepwner , we want the user to be able to tap an item to get another screen with edit-
able text fields for each property of that BNRItem . This view will be controlled by an in-
stance of DetailViewController .
The detail view needs four subviews - one for each instance variable of a BNRItem in-
stance. And because you need to be able to access these subviews during runtime, De-
tailViewController needs outlets for these subviews. Therefore, you need to add
four new outlets to DetailViewController , drag the subviews onto the view in the
XIB file, and then make the connections.
In previous exercises, these were three distinct steps: you added the outlets in the interface
file, then you configured the interface in the XIB file, and then you made connections. We
can combine these steps using a shortcut in Xcode . First, open DetailViewControl-
ler.xib by selecting it in the project navigator.
Now, Option-click on DetailViewController.h in the project navigator. This
shortcut opens the file in the assistant editor , right next to DetailViewControl-
ler.xib . (You can toggle the assistant editor by clicking the middle button from the Ed-
itor control at the top of the workspace; the shortcut to display the assistant editor is
Command-Option-Return; to return to the standard editor, use Command-Return.)
You will also need the object library available so that you can drag the subviews onto the
view. Show the utilities area by clicking the right button in the View control at the top of
the workspace (or Command-Option-0).
Your window is now sufficiently cluttered. Let's make some temporary space. Hide the
navigator area by clicking the left button in the View control at the top of the workspace
(the shortcut for this is Command-0). Then, change the outline view in the XIB file to the
dock view by clicking the toggle button in the lower left corner of the outline view. Your
workspace should now look like Figure 11.7 .
Figure 11.7 Laying out the workspace
 
Search WWH ::




Custom Search