LOL - all of what you just described was the hair-pulling extravaganza that led me to a more detailed look at File's Owner in the first place. Several weeks ago I was trying to get my model object out of the nib, or more specifically, to figure out how to connect the controller to it if there was no nib NSObject that had the Class Identity of the class that contained my Model objects.

I thought - aha, maybe this is what File's Owner is for, BECAUSE... you see many tutorials and examples of Cocoa Bindings where the author tells the reader to connect something to File's Owner. I thought maybe if you bind to File's Owner, it knows about all the keys in all of the objects in all of the classes of the app, so that you could just use File's Owner as the controller that the View object bound to, and write aClass.aKey as the Model Key Path.

I have since realized that I need to just make a separate class for the model objects in Xcode (what I was doing, without realizing it, was having my one class actually be the app controller as well as the Model). Then just flat-out explicitly instantiate that class in the App Controller code. Now I have a name for the Model class' instance.

Then in the bindings for my View Object, I can bind it to my NSArrayController's "selection" binding and set the model key path to myModelInstance.myModelKeyName.

Took about a month of 16-hour days to get that down.


On May 25, 2008, at 5:58 AM, [EMAIL PROTECTED] wrote:

I know this is a bit silly, for a singleton like that you may as well
just put the model in there, but I'm trying to figure out if you
didn't, what the right way to hook it up to the controller is later.

_______________________________________________

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