On Thu, Mar 20, 2008 at 3:53 PM, David <[EMAIL PROTECTED]> wrote: > I think this is a basic question.In interface builder you can specify > animations which occur when adding a view. Question is, where does the > view > typical come from? It seems desirable to be able to design a potentially > complex view in IB, obtain a reference to it and use it for animations. Or > is it assumed that you're programmatically creating the view?
The view can come from many places. It can come from the main NIB by using a IBOutlet to keep track of it. You can create it in code, or you can stick the view in its own NIB and load it with an NSViewController (or a hand-rolled view controller if you're pre-Leopard). There's no deep assumption here about where the view comes from. I personally find it handy to have several small NIBs rather than one complicated NIB, but it is a matter of style, preference and your particular problem. I also personally like to keep my NIBs very simple and move most complexity into the code because I find it easier to manage that way, especially with multiple people working on the same project. Again, though, that's just my preference. Cocoa is designed to handle any of these approaches. I've been trying to find similar examples to popup windows and found some > discussions stating that you can't find a window in the nib and that you > should have a separate NIB per window. It is often useful to create a separate NIB per window (I usually do), but you can certainly find a secondary window in a NIB if you tie it to an IBOutlet variable. You can even walk a NIB and find the window, as described here: http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/chapter_3_section_6.html This last technique is useful if you're trying to dynamically load NIBs at runtime that are not known at compile time (such as if you have a plug-in architecture). It's not the normal way to find a window. -Rob -- Rob Napier -- Software and Security Consulting -- http://robnapier.net "Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety." -- B. Franklin, Printer _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]