Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Challenge 18 in Hillegass Book



On Sat, Aug 9, 2008 at 8:54 PM, James Gorham <email@hidden> wrote:
I think that's where I'm unclear. Making the Document class aware of the
view is easy enough with an IBOutlet. But how to properly make the view
aware of the document I'm unsure of.

You're missing the point. You don't connect your NSDocument (model) to your views, you have a controller in between. This controller is responsible for noticing/being notified when the document changes so it can update the view, and it is also responsible for noticing/being notified when the view changes so it can update the document.

But the question I think is still valid and one I'm I'm trying to figure out myself. How, for instance, would you have the view request data from the document (or any other object for that matter). I understand that it may not always be the best design choices but how is it done? Posting notifications is about the only way I can think of and perhaps sending self as the context info.


Ashley Perrien
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.