Spotify iOS 앱에 cocoalibspotify를 사용하고 있습니다.SPPlaylistCallbackProxy 재생 목록 : 할당 취소 된 인스턴스로 전송 된 메시지
내 앱에서 한 지점에서 새로운 재생 목록을 만들고 재생 목록에 여러 개의 트랙을 추가하고 있습니다. 그렇게 할 때 생성 된 재생 목록 인스턴스가 할당 취소 된 것 같아서 충돌이 발생합니다.
[[[SPSession sharedSession] userPlaylists]
createPlaylistWithName:playlistName
callback:^(SPPlaylist *createdPlaylist) {
if (createdPlaylist) {
[SPAsyncLoading waitUntilLoaded:createdPlaylist
then:^(NSArray *playlists) {
// Load all tracks using the URI's and add them to the playlist
SPPlaylist *playlist = [playlists objectAtIndex:0];
for (NSString *trackUri in trackUris) {
[[SPSession sharedSession]
trackForURL:[NSURL URLWithString:trackUri]
callback:^(SPTrack *track) {
if (track != nil) {
[SPAsyncLoading
waitUntilLoaded:track
then:^(NSArray *tracks) {
[playlist addItems:tracks atIndex:0 callback:NULL];
}];
}
}];
}
}];
}}];
이 로그 메시지입니다 :
이
처럼 코드가 모습입니다*** -[SPPlaylistCallbackProxy playlist]: message sent to deallocated instance 0x100e0120
내 수업 시간에 재생 목록을 유지하려했지만, 난 여전히 받고 있어요 같은 문제. 내가 여기서 뭔가 분명한 것을 놓치고 있니?
보너스 질문 : 재생 목록을 만들거나 (즉, -trackForURL:callback
을 사용하여) 재생 목록을 만들거나로드 한 후 SPAsyncLoading
을 사용해야합니까, 아니면 항상 개체가 이미로드 되었습니까?
편집을 : 나는 무슨 일이 있었는지보고 악기 좀비를 실행하고 충돌 할 때 다음과 같은 결과를 얻었다 :
https://github.com/spotify/cocoalibspotify/issues/80에서 해결됩니다. –