【发布时间】:2012-04-09 17:18:15
【问题描述】:
有人知道为什么这段代码会在发布池中的某个地方崩溃(在调用“eject”之后)吗? 我在 AVPlayer 类参考中看到“currentItem”属性未声明为“保留”http://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVPlayer_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009530-CH1-SW21
这是 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];
}
【问题讨论】: