在针对spotify的最新测试版iOS sdk上调用playlistsForUserWithSession时,我会回到看似合适的阵列,因为我可以做一个' po pl.items'它在调试窗口中显示播放列表列表。但是,如果我尝试做pl.items.count,我会得到"会员参考基础类型' void *'不是一个结构或联盟"如果我尝试pl.items [0]返回错误"指针下标到不完整类型' void'"这是我的代码。感谢:
SPTAuth *auth = [SPTAuth defaultInstance];
//get list of current playlists
[SPTPlaylistList playlistsForUserWithSession:auth.session callback:^(NSError *error, id object) {
if (!error) {
NSURL *playlistURL = nil;
pl= object;
//at this point, the pl object isn't playing nice
if(pl != nil && pl.items != nil && pl.items.count > 0) {
playlistURL = [pl.items[0] uri];
} else {
//snipped code
}
NSString * theResult = [playlistURL absoluteString];
//snipped code
} else {
NSLog(@"Problem with the Spotify media Picker...");
}
}
}];
答案 0 :(得分:0)
在我的实施中,我使用tracksForPlayback
SPTTrackProvider
方法委托
代码段
@property (strong, nonatomic) SPTPlaylistList *SpotifyLists;
SPTPartialPlaylist *partialPlayList = [[_SpotifyLists tracksForPlayback] objectAtIndex:indexPath.row];
UIImage *placeHolder = [UIImage imageNamed:@"PlaceHolder.jpg"];
[cell.profileImageView setImageWithURL:partialPlayList.smallestImage.imageURL placeholderImage:placeHolder];
cell.titleLabel.text = [NSString stringWithFormat:@"%@", partialPlayList.name];
cell.auxilaryLabel.text = [@(partialPlayList.trackCount) stringValue];
不太确定何时使用items
属性
答案 1 :(得分:0)
事实证明,如果我通过代码访问它们,对象工作正常,但如果我尝试用PO命令查看它们它们就不起作用,所以看起来一切都很好。