Re: File's Owner
Re: File's Owner
- Subject: Re: File's Owner
- From: mmalc crawford <email@hidden>
- Date: Sun, 25 May 2008 02:14:40 -0700
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 (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