Parsing iTunes XML to NSTableView
Parsing iTunes XML to NSTableView
- Subject: Parsing iTunes XML to NSTableView
- From: Jeff Dlouhy <email@hidden>
- Date: Sun, 15 Jan 2006 15:30:12 -0500
Hi All,
I am a teenager new to Cocoa and I am trying to parse the iTunes
Library XML and trying to put the library into a NSTableView. I can't
seem to get it to work here is some of the code I am using.
while ((thisTrack = [trackEnumerator nextObject]))
{
NSDictionary *trackInfo;
NSNumber *bitRate;
NSString *location;
NSString *name;
NSString *artist;
NSString *album;
if (!(artist = [thisTrack objectForKey:@"Artist"]))
{
artist = @"N/A";
}
if (!(album = [thisTrack objectForKey:@"Album"]))
{
album = @"N/A";
}
location = [thisTrack objectForKey:@"Location"];
name = [thisTrack objectForKey:@"Name"];
bitRate = [thisTrack objectForKey:@"Bit Rate"];
trackInfo = [NSDictionary dictionaryWithObjectsAndKeys:
location, @"Location",
artist, @"Artist",
name, @"Name",
album, @"Album",
bitRate, @"BitRate",
nil];
[songArray addObject:trackInfo];
}
Everything is initalized above the loop, just couldn't fit it in the
e-mail, the thing im really having problems is with getting that
information into a table with columns. I don't understand
NSDictionarty all that well.
Thanks,
Jeff Dlouhy
_______________________________________________
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