spotify/cocoalibspotify — Issue #20: Issue with SPSearch
Author: jjpenney
Created: 2011-10-28 16:14:56+00:00
State: open

It seems that you need to use a different SPSearch object if you plan to deal with the artist/album/tracks, separately.

I noticed that if you call the following;

[searchResults addTrackPage];

Then ALL of the hasExhausted* variables are set to 'yes', even if the 'tracks' are not exhausted. The reason for this is because of the 'searchDidComplete' function. This iterates through the results and checks if there are any available results for each 'category' (artist/albums/tracks). Since we are only adding tracks, the number of returned objects for the albums and artists, will be 0. This causes a problem when the following is called in this function;

self.hasExhaustedArtistResults = (artistCount < pageSize);

&

self.hasExhaustedAlbumResults = (albumCount < pageSize);

Obviously, artistCount and albumCount will be 0, because we're not adding anything for that 'category'.

For the moment, as my workaround, I've just set a few BOOL's to check whether we're actually adding pages for that particular category and this seems to work for me.