Re: iTunes Music Library parsing help
Re: iTunes Music Library parsing help
- Subject: Re: iTunes Music Library parsing help
- From: Dave DeLong <email@hidden>
- Date: Sun, 06 Mar 2005 16:42:07 -0700
Thanks James,
It now takes about 4 seconds. =D
Thanks a ton!
Dave DeLong
On Mar 6, 2005, at 3:05 PM, James B. Tuley wrote:
An NSDictionary is basically a HashTable, this algorithm you wrote
pretty much puts the preexisting table of tracks hashed by ID it into
an array that you are using to look up songs, and causes you to have
to iterate through song library until you find the song each time,
defeating the purpose of it being already in a hashtable.
I made the slightest modification to this section of your code to
allow quick lookups of the songs by id->
NSArray * ids = [currentList objectForKey:@"Playlist Items"];
NSEnumerator * idEnumerator = [ids objectEnumerator];
NSDictionary * currentId;
NSMutableArray * playSongs = [[NSMutableArray alloc] init];
while (currentId = [idEnumerator nextObject])
{
NSString* i = [currentId objectForKey:@"Track ID"];
NSDictionary* songFromID =[tracks objectForKey: i];
[playSongs addObject:songFromID];
}
-Jay
http://indyjt.com
_______________________________________________
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
_______________________________________________
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