问题
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