0

使用 Spotify iOS SDK Beta 5,当我使用以下方法请求播放列表时:

[SPTRequest playlistsForUserInSession:self.session callback:^(NSError *error, id object) {
    self.playlists = ((SPTListPage*)object).items;
}];

我得到一个列表,其中包含 Spotify 桌面应用程序吸收的本地 Spotify 和 iTunes 播放列表。列表条目中没有任何内容可以消除它们的歧义。如果我尝试使用以下代码播放其中一个 iTunes 播放列表:

[SPTRequest requestItemAtURI:uri
                 withSession:session
                    callback:^(NSError *error, id object) {

                        if (error != nil) {
                            NSLog(@"*** got error %@", error);
                            return;
                        }

                        [self.streamer playTrackProvider:object callback:^(NSError *error) {
                            NSLog (@"*** reached callback");
                        }];

                    }];

我的应用程序在 Spotify SDK 中崩溃,出现以下错误:

-[NSNull caseInsensitiveCompare:]: unrecognized selector sent to instance 0x198ba9fe0

这个堆栈跟踪:

Thread 10, Queue : com.apple.root.default-priority
#0  0x000000019816c1c0 in objc_exception_throw ()
#1  0x000000018bc67db4 in -[NSObject(NSObject) doesNotRecognizeSelector:] ()
#2  0x000000018bc65ae0 in ___forwarding___ ()
#3  0x000000018bb8578c in _CF_forwarding_prep_0 ()
#4  0x0000000100099d40 in -[SPTPartialAlbum initWithDecodedJSONObject:error:] at /Users/po/Projects/ios-sdk/src/SPTPartialAlbum.m:85
#5  0x00000001000a6578 in +[SPTJSONDecoding SPObjectFromDecodedJSON:collection:error:] at /Users/po/Projects/ios-sdk/src/SPTJSONDecoding.m:95
#6  0x000000010008bd2c in -[SPTTrack initWithDecodedJSONObject:error:] at /Users/po/Projects/ios-sdk/src/SPTTrack.m:83
#7  0x000000010008a350 in -[SPTPlaylistTrack initWithDecodedJSONObject:error:] at /Users/po/Projects/ios-sdk/src/SPTPlaylistTrack.m:44
#8  0x00000001000a6578 in +[SPTJSONDecoding SPObjectFromDecodedJSON:collection:error:] at /Users/po/Projects/ios-sdk/src/SPTJSONDecoding.m:95
#9  0x0000000100096ebc in -[SPTListPage initWithDecodedJSONObject:expectingPartialChildren:rootObjectKey:] at /Users/po/Projects/ios-sdk/src/SPTListPage.m:84
#10 0x000000010008fcac in -[SPTPlaylistSnapshot initWithDecodedJSONObject:error:] at /Users/po/Projects/ios-sdk/src/SPTPlaylistSnapshot.m:137
#11 0x00000001000a6578 in +[SPTJSONDecoding SPObjectFromDecodedJSON:collection:error:] at /Users/po/Projects/ios-sdk/src/SPTJSONDecoding.m:95
#12 0x00000001000a1664 in __56+[SPTRequest requestPlaylistAtURI:withSession:callback:]_block_invoke at /Users/po/Projects/ios-sdk/src/SPTRequest.m:595
#13 0x0000000198744014 in _dispatch_call_block_and_release ()
#14 0x0000000198743fd4 in _dispatch_client_callout ()
#15 0x000000019874b2b8 in _dispatch_root_queue_drain ()
#16 0x000000019874b4fc in _dispatch_worker_thread2 ()
#17 0x00000001988d96bc in _pthread_wqthread ()

原生 Spotify 播放列表播放良好。

帮助!有解决方法吗?我认为在请求播放列表时不应由 SDK 返回 iTunes 播放列表。或者,给我一些东西,我可以用来确定哪些播放列表是基于 iTunes 的,这样我就可以对我的 iOS 应用程序的用户隐藏它们。或者,尝试播放一个时不要在 SDK 中崩溃。

Spotify SDK 开发人员:救命!?以前的 SDK 显示了 iTunes 播放列表,但在通过 requestItemAtURI 请求播放列表时没有崩溃。

4

0 回答 0