Information Technology Reference
In-Depth Information
Figure 7.2 shows the hierarchy after a view swap. The window remains in place, as does the original view con-
troller. A new controller object is created in code and initialized with a nib file. A separate swap operation in
code swaps out the old view, releases it from memory, and plugs in the newly loaded view. The new controller
handles user events for the new view. The old controller manages further view swaps, if there are any. Option-
ally, it can run further code in the background in a separate thread.
It's important to understand these relationships because IB doesn't make the nib hierarchy explicit. There's no
automated feature that tells IB to create the classes and features needed for a view swap. Instead, you must add
view and view controller classes manually and organize them correctly.
FIGURE 7.2
This shows the new hierarchy during and after a view swap operation. Creating a new view controller object loads
its nib file. The swap operation has to be done manually, using further code.
Search WWH ::




Custom Search