| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
2) Drag another "Custom View" from the palette into your nib document window (the window which shows the File's Owner, First Responder, etc). This is what Vince was talking about.
3) Double click this new custom view, fill it up with whatever UI stuff you need for one of your "swappable" views.
4) For whatever object in your nib file is serving as controller (e.g. your window controller or some other controller object instantiated in the nib), make sure that it has an outlet for each custom view you need. Ctrl-drag a connection from the controller to the new custom view you just created and hook it up to the appropriate outlet.
5) Repeat steps 2-4 for each custom view you need. Then you can define a single method to switch among the custom views, which does something like
[theSuperview replaceSubview:currentCustomView with:newCustomView];
That way, you can have more than one custom view in your single nib file. (If your custom views were numerous or complex, it might be desirable to separate them into multiple nib files that get loaded on demand, but your scenario seems simple.)
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.