简体   繁体   English

无法识别的选择器已发送到实例('NSInvalidArgumentException')

[英]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! 请帮忙!

Try like this 这样尝试

Open storyboard in Scrollview choose the video view and then Choose the Custom class.Then give the class name as GVRVideoView. 在Scrollview中打开情节提要板,选择视频视图,然后选择Custom类,然后将类名命名为GVRVideoView。

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 NSInvalidArgumentException:无法识别的选择器发送到实例 - NSInvalidArgumentException: unrecognized selector sent to instance NSInvalidArgumentException无法识别的选择器已发送到实例 - NSInvalidArgumentException unrecognized selector sent to instance NSInvalidArgumentException:“无法识别的选择器发送到实例” - NSInvalidArgumentException: “Unrecognized selector sent to instance” NSInvalidArgumentException || 无法识别的选择器已发送到实例 - NSInvalidArgumentException || Unrecognized selector sent to instance iOS NSInvalidArgumentException,无法识别的选择器发送到实例 - iOS NSInvalidArgumentException, unrecognized selector sent to instance 错误:&#39;NSInvalidArgumentException&#39;...发送到实例的无法识别的选择器 - Error: 'NSInvalidArgumentException' … unrecognized selector sent to instance NSInvalidArgumentException - [__ NSCFString unsignedLongLongValue]:发送到实例的无法识别的选择器 - NSInvalidArgumentException -[__NSCFString unsignedLongLongValue]: unrecognized selector sent to instance NSInvalidArgumentException-[NSNull长度]:无法识别的选择器已发送到实例 - NSInvalidArgumentException -[NSNull length]: unrecognized selector sent to instance NSInvalidArgumentException,原因无法识别的选择器发送到实例 - NSInvalidArgumentException, reason unrecognized selector sent to instance 另一个“ NSInvalidArgumentException:无法识别的选择器发送到实例”帖子 - Another “NSInvalidArgumentException: unrecognized selector sent to instance” post
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM