我正在尝试设置一个简单的 Sprite Kit 设置。我所做的只是从“空应用程序”重新创建默认的 xCode 模板“Sprite Kit Game”。
它不断在skView.showsFPS = YES;上崩溃 线。我无法解释。你能?谢谢!
一些代码:
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
MenuController *menuController = [[MenuController alloc] init];
self.window.rootViewController = menuController;
[self.window makeKeyAndVisible];
return YES;
}
菜单控制器.m
- (void)viewDidLoad
{
[super viewDidLoad];
SKView *skView = (SKView *)self.view;
skView.showsFPS = YES;
skView.showsNodeCount = YES;
MultiplayerView *gameView = [MultiplayerView sceneWithSize:skView.bounds.size];
gameView.scaleMode = SKSceneScaleModeAspectFill;
[skView presentScene:gameView];
}
当我启动它时,会发生以下错误:
2013-11-10 13:08:01.605 ByS[9419:70b] -[UIView setShowsFPS:]: unrecognized selector sent to instance 0x10c00bc60
2013-11-10 13:08:01.608 ByS[9419:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setShowsFPS:]: unrecognized selector sent to instance 0x10c00bc60'