On this topic, when I drag an object out of the Library and set its class, IB sets the label of the object to the Class Name. Since this is an instance of the class, and not the Class Object itself, why is the name capitalized?

It's just a convenient label. If you have two ThingController instances and one controls SomeThing and the other controls AnotherThing, you'll want to name them something easily identifiable: SomeThing Controller and AnotherThing Controller. It's just for easy identification during developer editing.

And if I want to refer by name to that instance in my code, what is the name of the instance?

Nothing. That is, not until you add an IBOutlet in whatever class you want to connect to that instance. Say "AppController" has an outlet called "thingController". You can then connect the AppController's someThingController outlet to the "Some Thing Controller" instance. Now, anywhere within your AppController class, you can send messages to the "Some Thing Controller" instance by its shiny new name:

[someThingController doSomeThing];

Also, I found out that IB will not let me make 2 instances of the same Class. In code, I could say myClassInstance1 = [MyClass new]; and MyClassInstance2 = [MyClass new];, but apparently not in IB.

Sure you can. Exactly the same way you did it the first time. A new instance is created. Whether you use the "Instantiate ..." menu item or drag an NSObject instance into your nib and change its class, doing it a second time creates a new instance.

  Are you doing something differently or getting an error?

This has been a mystery to me for six years now.

  Ouch.


Also, the documentation only says about File's Owner that it is the object that loaded the nib file. What is that object, if my nib file just gets loaded at application launch?

  Your app's NSApplication instance. This is in the documentation.

--
I.S.


_______________________________________________

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]

Reply via email to