Question about MVC
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