Information Technology Reference
In-Depth Information
FIGURE 8.9
Adding custom attributes to an object
CAUTION
In the first release of Xcode 4, this feature wasn't working correctly. In Xcode 3 it was available for OS X only. It's
likely to be fixed in a future release—but check it before you use it.
Subclassing File's Owner
Note that you can follow the steps given above to subclass File's Owner. Typically, you don't need to do this un-
less you want to add features to the NSApplication/UIApplication classes, or you have a complex nib hierarchy
and you need to add code to an element buried in the view hierarchy. For simpler apps, you can leave the de-
fault File's Owner class assignments unchanged. But it's useful to remember that even though File's Owner is a
placeholder, you can still set its class using the Identity Inspector.
Creating Custom Objects
Sometimes you want to reuse custom objects in other projects. To simplify this, you can add your own objects
to the Object Library in IB. But it isn't usually necessary to do this. Even if you reuse objects, it's often simpler
to import them again and subclass them again than it is to create a stand-alone plug-in.
 
Search WWH ::




Custom Search