Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
- Subject: Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
- From: Graham Cox <email@hidden>
- Date: Fri, 23 Oct 2009 13:33:40 +1100
On 23/10/2009, at 1:15 PM, Michael de Haan wrote:
In words, ( also tried to do it diagrammatically...see below)
In the dataSource object ( which in this case is a doc subclass) I
have declared an array as an Ivar ( I called it "_record_list"). To
this array, I added the object created in the AddRecord method of
the doc object. That object is the NSMutableDictionary Object,
(which uses the returned object from the Record Class init method).
So, ( and I hope this comes out)
So ---> AddRecord (in doc class) ---> init ( Record Class)
|
|
|
↓
Record_object ( with 4 values ) ---> Returned to AddRecord Method
-------> Used to create NSMutableDictionary Object ---------> Added
to Doc Array----------> Used by TableView as source of display in
tableView.
I'm still unclear why there is a (mutable) dictionary in here at all.
There's no need to have one. The simplest design is an array of
Record_objects, the table can populate itself perfectly well from that
(provided the Record_object's properties are identified in the table,
which they surely must be).
--Graham
_______________________________________________
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