-[UIView setShowsFPS:]: unrecognized selector error

坚强是说给别人听的谎言 提交于 2019-12-11 03:04:24

问题


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];

when it take the final line

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

it give me the following error:

-[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!!


回答1:


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.

Write "SKView" and try to run again.

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



来源:https://stackoverflow.com/questions/17685769/uiview-setshowsfps-unrecognized-selector-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!