Graphics Programs Reference
In-Depth Information
- (IBAction)addNewItem:(id)sender;
- (IBAction)toggleEditingMode:(id)sender;
@end
Notice that
headerView
is a strong reference. This is because it will be a top-level ob-
ject in the XIB file.
Now we need to create the new XIB file. Unlike the previous XIB files you created, this
XIB file won't deal at all with the view controller's
view
. (As a subclass of
UIT-
ableViewController
,
ItemsViewController
already knows how to create its
view
.) XIB files are typically used to create the view for a view controller, but they can
also be used any time you want to layout view objects, archive them, and have them
loaded at runtime.
From the
File
menu, select
New
and then
New File...
. From the
iOS
section, select
User
Interface
, choose the
Empty
template, and hit
Next
(
Figure 10.3
). On the next pane, select
iPhone
. Save this file as
HeaderView
.
Figure 10.3 Creating a new XIB file