• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File's Owner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: File's Owner
      • From: Ken Thomases <email@hidden>
References: 
 >Re: File's Owner (From: Johnny Lundy <email@hidden>)
 >Re: File's Owner (From: Scott Anguish <email@hidden>)
 >Re: File's Owner (From: Roland King <email@hidden>)

  • Prev by Date: Re: File's Owner
  • Next by Date: Re: How to Delay, Wait, Pause...
  • Previous by thread: Re: File's Owner
  • Next by thread: Re: File's Owner
  • Index(es):
    • Date
    • Thread