Re: Add record to NSDictionary
Re: Add record to NSDictionary
- Subject: Re: Add record to NSDictionary
- From: Charilaos Skiadas <email@hidden>
- Date: Sun, 24 Jul 2005 21:23:32 -0500
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