File's owner quetion
File's owner quetion
- Subject: File's owner quetion
- From: John Newlin <email@hidden>
- Date: Tue, 29 Jan 2008 08:48:23 -0800
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
"MyGreatClass"
- 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
made.
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?
I hope that makes sense, my English is not very good. :)
-john
_______________________________________________
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