• 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
MVC and Cocoa question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: MVC and Cocoa question
      • From: Graham Cox <email@hidden>
    • Re: MVC and Cocoa question
      • From: "Kyle Sluder" <email@hidden>
  • Prev by Date: Re: How to manage (My)SQL data in Cocoa
  • Next by Date: Re: A trapped keyDown event
  • Previous by thread: Re: Floating point pixel data / image handling confusion
  • Next by thread: Re: MVC and Cocoa question
  • Index(es):
    • Date
    • Thread