0
NSString *strUrlSearch=@"http://ws.spotify.com/search/1/track.json?q=kaizers+orchestra";
    [[SPSession sharedSession] searchForURL:[NSURL URLWithString:strUrlSearch] callback:^(SPSearch *search) {
        NSLog(@"search value %@",search);
        if (search != nil) {
            [SPAsyncLoading waitUntilLoaded:search timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems) {
                NSLog(@"values %@",search);
                NSLog(@"values %@",search.tracks);
                NSLog(@"values %@",search.albums);

            }];
        }else{
            NSLog(@"search is nil ");
        }

    }];

我的输出是“搜索为零”..我真的很沮丧为什么它为零..请帮助我..问题是什么...

4

1 回答 1

1

SPSearch不带ws.spotify.com链接。

相反,直接给它搜索短语(而不是 URL 编码),如下所示:

SPSearch *search = [SPSearch searchWithSearchQuery:@"kaisers orchestra"
                                         inSession:[SPSession sharedSession]];
于 2013-11-07T10:10:11.917 回答