【发布时间】:2014-08-09 19:29:09
【问题描述】:
嗯,这很奇怪:我想尝试使用 Swift 和 Xcode6-b5 创建一个小的 Mac 游戏,但是当我打开一个新的项目模板并且没有更改任何内容时,GameScene 没有加载并且控制台显示这些当我尝试运行它时有两行:
2014-08-09 20:50:21.294 PokemonSK[3808:303] +[PokemonSK.GameScene nodeWithFileNamed:]: unrecognized selector sent to class 0x100009150
2014-08-09 20:50:21.295 PokemonSK[3808:303] +[PokemonSK.GameScene nodeWithFileNamed:]: unrecognized selector sent to class 0x100009150
我在Link1 看到了类似的主题,但他们没有解释如何修复它,我不想升级到优胜美地......
有人想办法解决这个问题吗?
谢谢
(这里是 AppDelegate 代码,它可能会有所帮助)
import Cocoa
import SpriteKit
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet var window: NSWindow!
@IBOutlet var skView: SKView!
func applicationDidFinishLaunching(aNotification: NSNotification?) {
/* Pick a size for the scene */
let scene = GameScene(fileNamed: "GameScene")
/* Set the scale mode to scale to fit the window */
scene.scaleMode = .AspectFill
self.skView!.presentScene(scene)
/* Sprite Kit applies additional optimizations to improve rendering performance */
self.skView!.ignoresSiblingOrder = true
}
func applicationShouldTerminateAfterLastWindowClosed(sender: NSApplication) -> Bool {
return true;
【问题讨论】:
-
苹果是否也同时发布了新的 osx 测试版?如果是这样,您可能也需要安装它
-
好吧,不只是我有这个...
-
那么,如果这仅适用于 10.10,那么如果我们想要针对更多种类的机器,这对我们意味着什么?我们应该期待 Apple 为旧操作系统发布新的 SpriteKit,还是我们必须手动删除所有这些代码?
标签: macos templates swift sprite-kit