• 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
Question about MVC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about MVC


  • Subject: Question about MVC
  • From: Michael de Haan <email@hidden>
  • Date: Fri, 18 Dec 2009 07:37:42 -0800

In Cocoa Design Patterns, Chap 29 re-creates, from scratch, an NSArrayController, dissecting in great detail how it works. The example essentially is a very rudimentary drawing program, which shows rectangles in a view, with a table showing the coordinates of the same.

My question relates to the essence of the demo, viz the array of the model objects, specifically an NSArray in the controller.

The approach taken is that as each model object is created, it is not added to the array, but a new array is formed with each new model object created, and assigned to the NSArray.
So, why would  one not simply use an NSMutableArray and simple add or delete model objects. I suspect part of the answer is that assigning a new array allows easier use of KVC but I am not sure as this is not specifically explained.

Thanks for your input.



_______________________________________________

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: Question about MVC
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: App works when launched from Xcode, not from Finder
  • Next by Date: Re: Enabling menu items...
  • Previous by thread: Re: Outline View CancelEditing
  • Next by thread: Re: Question about MVC
  • Index(es):
    • Date
    • Thread