-[UIView setShowsFPS:]: 无法识别的选择器错误 [英] -[UIView setShowsFPS:]: unrecognized selector error

查看:36
本文介绍了-[UIView setShowsFPS:]: 无法识别的选择器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在按下 UIButton 时打开一个 ViewController,为此我使用以下方法代码:

I need to open a ViewController when a UIButton was press , for doing that I use the following code :

NSString * storyboardName = @"Main";
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
[self presentViewController:vc animated:YES completion:nil];

最后一行时

[self presentViewController:vc animated:YES completion:nil];

它给了我以下错误:

-[UIView setShowsFPS:]:无法识别的选择器发送到实例 0x9bd5610 2013-07-16 14:40:52.728 ChainZoo[3026:a0b] * 终止应用程序由于未捕获的异常NSInvalidArgumentException",原因:'-[UIView setShowsFPS:]: 无法识别的选择器发送到实例0x9bd5610'

-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x9bd5610 2013-07-16 14:40:52.728 ChainZoo[3026:a0b] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x9bd5610'

有人知道错误吗?提前致谢!!

Anyone knows the error? thanks in advance!!

推荐答案

storyborad 上,选择您的 ViewController 的视图,然后单击显示身份检查器"(右上角的第三个小标签).

On the storyborad, select your ViewController's view and click "Show the identity inspector" (third little tab on the top right side).

您将看到自定义类文本视图.

You'll see Custom Class textview.

编写SKView"并尝试再次运行.

Write "SKView" and try to run again.

您应该将 VC 的视图初始化为 SKView.

You should init your VC's view as a SKView.

这篇关于-[UIView setShowsFPS:]: 无法识别的选择器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆