On 19-Oct-2009, at 8:51 AM, Phil Hystad wrote:
Given that I have an object defined in the nib (aka xib), for example, an object that responds to a given view, what is the correct way for my running application (if it is in some other state, not responding to an action) to obtain a pointer to that object.

The "File's Owner" is what you're after!

The docs are here:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW15

Maybe a second question is "Do I ever need to do this?".
Yes, yes, yes and yes! ;-)

Some examples:
1) initialization of state so that objects from a nib file are in sync with your controller
2) state updates
3) enable/disable of optional UI components
4) dynamic changes to the UI which could not be foreseen before runtime.
etc, etc

Regards!
M.
_______________________________________________

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 arch...@mail-archive.com

Reply via email to