• 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
Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The "correct" approach? Question about creating an NSMutableDictionary instance.


  • Subject: Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
  • From: Michael de Haan <email@hidden>
  • Date: Thu, 22 Oct 2009 19:38:34 -0700


On Oct 22, 2009, at 7:33 PM, Graham Cox 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).


OK...I see what you are saying. I did not know I could do it that way ie simply add the object "Record" to the record_list. I had seen an example from the documentation which had sued this approach, so simply followed that example! :-)

_______________________________________________

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


References: 
 >The "correct" approach? Question about creating an NSMutableDictionary instance. (From: Michael de Haan <email@hidden>)
 >Re: The "correct" approach? Question about creating an NSMutableDictionary instance. (From: Graham Cox <email@hidden>)
 >Re: The "correct" approach? Question about creating an NSMutableDictionary instance. (From: Michael de Haan <email@hidden>)
 >Re: The "correct" approach? Question about creating an NSMutableDictionary instance. (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
  • Next by Date: NSDate timeIntervalSinceNow problem
  • Previous by thread: Re: The "correct" approach? Question about creating an NSMutableDictionary instance.
  • Next by thread: NSDate timeIntervalSinceNow problem
  • Index(es):
    • Date
    • Thread