MVC and Cocoa question
MVC and Cocoa question
- Subject: MVC and Cocoa question
- From: Steven Guitar <email@hidden>
- Date: Mon, 10 Nov 2008 10:56:59 -0600
i am working on the challenge exercises for aaron hillegass' book, 3rd
edition, for chapter 18 challenge. i have setup the application with a
subclass of NSDocument (MyDocument), a subclass of NSView
(DrawPadView), and a model component called Shape.
basically as the user uses the mouse to draw shapes, i have an
NSMutableArray in DrawPadView that contains the various shapes drawn
by the user.
when it comes time to save this file, MyDocument is going to do all
the work, but the only way i can think of to get an NSMutableArray in
MyDocument to have the values of the array in the DrawPadView is to
use the NSNotificationCenter.
is this ok? should i have my NSDocument class register as an observer
of the NSView class? i was not sure if this was going against MVC or
any other cocoa design patterns.
i have been racking my brain to get this thing to save and really just
keep hitting dead ends, but this path sounds logical to me... any
thoughts?
_______________________________________________
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