• 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: Add record to NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add record to NSDictionary


  • Subject: Re: Add record to NSDictionary
  • From: Jerry Brace <email@hidden>
  • Date: Mon, 25 Jul 2005 05:54:43 -0230

Sorry about the mixup - I have this issue resolved. I was up a little too late coding - makes more sense in the morning :)

Cheers,
Jerry


On 24-Jul-05, at 11:53 PM, Charilaos Skiadas wrote:

On Jul 24, 2005, at 6:01 PM, Jerry Brace wrote:


I have a NSDictionary setup which gets filled with data from an external xml file.
I am wondering now how I can add another record to the NSDictionary after the initial fill


NSURL * iTunesDatabaseLocation = [NSURL fileURLWithPath:[@"~/Music/ iTunes/iTunes Music Library.xml" stringByExpandingTildeInPath]];
NSMutableDictionary * iTunesDatabase = [NSMutableDictionary :iTunesDatabaseLocation];


In short - I need to add another record to the NSMutableDictionary named "iTunesDatabase".


I am not suree what you mean by a record, but a dictionary contains keys, and objects corresponding to them. To add a new key, you would use setObject:forKey:
Now, if you want to add a whole different thing obtained by another call to a different xml file, then there is a good chance you'll have a clash of keys, so you'll need to decide what to do in that case. In any case, the documentation for NSDictionary and NSMutableDictionary should have all you need.



Any help would be great - I know I should know how to do this.

Cheers,
Jerry


Haris




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Add record to NSDictionary (From: Jerry Brace <email@hidden>)
 >Re: Add record to NSDictionary (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: Problem with japanese systems [The Why of all this]
  • Next by Date: CIFilter not releasing GL_FRAGMENT_PROGRAM_ARB
  • Previous by thread: Re: Add record to NSDictionary
  • Next by thread: Unable to set up Apple's PDFKitLinker2 example code: project can't "find" PDFKit.framework
  • Index(es):
    • Date
    • Thread