• 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: iTunes Music Library parsing help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >iTunes Music Library parsing help (From: Dave DeLong <email@hidden>)
 >Re: iTunes Music Library parsing help (From: "James B. Tuley" <email@hidden>)

  • Prev by Date: Re: -[NSSet initWithSet:copyItems:] crashing
  • Next by Date: Re: Learning Cocoa/ObjectiveC and wondering why I had to do this.
  • Previous by thread: Re: iTunes Music Library parsing help
  • Next by thread: Any method to prevent context help mode?
  • Index(es):
    • Date
    • Thread