On Jan 29, 2008 8:48 AM, John Newlin <email@hidden> wrote:
> I'm new to Cocoa, so sorry for what is probably a simple question: :)
> I seem to have stumbled on a behavior that I guess should have been
> obvious, but was not obvious (at least to me) from the documentation.
> If I do the following:
> - I create a nib file, and set the class of File's Owner to
> - Create an instance of MyGreatClass e.g. [[MyGreatClass alloc] init]
> - Call a method that then opens the above nib file.
> The outlets in "MyGreatClass" seem to become automatically connected
> to their counterparts in the nib. For example if I have an
> NSTextField outlet in "MyGreatClass", and connect it that to a real
> field in IB, when I open the nib file this connection is automatically
> So here's the dumb question: Is that what is supposed to happen? ;)
> And second quetion: What happens if a method in "SomeOtherClass"
> opens the nib file whose File's Owner is "MyGreatClass". Will an
> instance of "MyGreatClass" be created, and if so how does one get
> handle/pointer to that instance. Or is what I'm doing the expected
> way to work, where I first create an instance of the class, and then
> have a method in that class open the nib file?
When you load a nib you provide it an instance of the object to use as
the files owner.
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden