有人知道爲什麼此代碼在發佈池中的某處崩潰(在調用「eject」之後)? 我在AVPlayer類參考中看到'currentItem'屬性未被聲明爲'retain'http://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009530-CH1-SW21AVPlayer不保留AVPlayerItem
這是AVPlayer類中的錯誤還是應該保留在其他位置?
謝謝!
- (void) viewDidLoad {
NSURL *url = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
playerItem = [[AVPlayerItem alloc] initWithURL:url];
player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
}
- (IBAction) eject {
[player release];
[playerItem release];
}
感謝您的回覆。在釋放播放器控制器之前,我最終通過從其超級視圖中移除播放器控制器(包含AVPlayer)而成功釋放了沒有任何崩潰的聲音。 – 2011-01-24 09:54:01