On May 25, 2008, at 2:01 AM, Roland King wrote:

Where do I make the model object and how do I hook it into the controller? I start the application, the Files Owner is the singleton NSApplication, I guess I can override the NIB finished loading method, make the model object there and now I want to call something on the controller like ...
-(Controller)hereIsYourModelObject:(Model*)model

If you override -awakeFromNib then you'd do so in the controller class, so it would create and set its own model. There's no need to invoke a separate hereIsYourModelObject: method, except in the sense of a setModelObject: accessor.
Alternatively you could do it in -init...

This is akin to, in the document architecture, the document object setting its model by retrieving it from a file.


Do I subclass NSApplication

No, you should almost never subclass NSApplication. You would use delegation instead.

mmalc

_______________________________________________

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