Creating a new track via the URL is incredibly inefficient — the SPPlaylistItem
contains the track itself.
Replace the part where you get the track by URL with something like this and you should be fine:
for (SPPlaylistItem *item in playlist.items) {
if (item.itemClass == [SPTrack class])
[mutableArray addObject:item.item];
}
Also, it's worth noting that fetching all of the tracks from a playlist at once is a fairly bad idea — playlists get very large, and holding onto 10,000 tracks when you've only got 20 or so onscreen at once is going to make you run out of memory fairly quickly.