Ios '-[AVPlayer superview]:发送到实例0x21011ad0'的无法识别的选择器;
每当我尝试播放视频时,我的应用程序总是崩溃,尽管我的AVPlayer实例被保留Ios '-[AVPlayer superview]:发送到实例0x21011ad0'的无法识别的选择器;,ios,objective-c,avfoundation,avplayer,unrecognized-selector,Ios,Objective C,Avfoundation,Avplayer,Unrecognized Selector,每当我尝试播放视频时,我的应用程序总是崩溃,尽管我的AVPlayer实例被保留 NSURL *url = [[NSBundle mainBundle] URLForResource:@"dd4dcafeea5111e1ad6712313b030e5d" withExtension:@"mp4"]; self.videoPlayer = [AVPlayer playerWithURL:url]; [self addSubview:self.videoPlayer]; [((AVPlayer *)
NSURL *url = [[NSBundle mainBundle] URLForResource:@"dd4dcafeea5111e1ad6712313b030e5d" withExtension:@"mp4"];
self.videoPlayer = [AVPlayer playerWithURL:url];
[self addSubview:self.videoPlayer];
[((AVPlayer *)self.videoPlayer) play];
正在将其分配给此属性:
@property (strong) id videoPlayer;
这是怎么回事?我没有保留我应该保留的东西吗?
AVPlayer
不是UIView
的子类。无法将模型对象添加到视图层次结构中