[英]Unrecognized selector sent to instance ('NSInvalidArgumentException')
I'm setting up a class to view video using Google VR. 我正在设置一个班级,以使用Google VR观看视频。 It runs without error using the sample code. 使用示例代码,它可以正确运行。 When I copy the class and view controller over to my project, this error occurs: 当我将类和视图控制器复制到我的项目中时,会发生此错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setDelegate:]: unrecognized selector sent to instance 0x109d04d90' 由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[UIView setDelegate:]:无法识别的选择器发送到实例0x109d04d90'
Here's the relevant code: 以下是相关代码:
@interface VideoPlayerViewController () <GVRVideoViewDelegate>
@property(nonatomic) IBOutlet GVRVideoView *videoView;
@property(nonatomic) IBOutlet UITextView *attributionTextView;
@end
_videoView.delegate = self;
_videoView.enableFullscreenButton = YES;
_videoView.enableCardboardButton = YES;
_videoView.enableTouchTracking = YES;
I can't figure out why it works in one instance and not the other. 我不知道为什么它在一个实例中起作用而在另一个实例中不起作用。 Everything is connected up in the storyboard. 一切都已连接到情节提要中。
This is driving me crazy. 这真让我抓狂。 Please help! 请帮忙!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.