【发布时间】:2014-06-18 03:36:54
【问题描述】:
如何检测 spotify 是否加载失败。如果设备没有互联网连接,我知道 SPAsyncLoad 仍然可以获取缓存的曲目。但是,如果没有互联网连接或由于某些错误而无法跟踪,有没有办法检测 SPAsyncLoad 中的加载失败?
【问题讨论】:
标签: ios spotify cocoalibspotify-2.0
如何检测 spotify 是否加载失败。如果设备没有互联网连接,我知道 SPAsyncLoad 仍然可以获取缓存的曲目。但是,如果没有互联网连接或由于某些错误而无法跟踪,有没有办法检测 SPAsyncLoad 中的加载失败?
【问题讨论】:
标签: ios spotify cocoalibspotify-2.0
SPAsyncLoading 的回调包含两个参数。第一个是已加载的项目数组,第二个是未加载的项目。
[SPAsyncLoading waitUntilLoaded:items timeout:kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems) {
if (notLoadedItems.count > 0) {
NSLog(@"Some items failed to load!");
}
}];
【讨论】: