Swift 和 Spritekit 无法在运行 iOS 7.1 的设备上运行 [英] Swift and Spritekit won't run on device running iOS 7.1

查看:26
本文介绍了Swift 和 Spritekit 无法在运行 iOS 7.1 的设备上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用 Xcode 6 在我的设备上运行我的 Swift 项目时,我收到了一个非常奇怪的警告.

I'm getting a really weird warning when I try to run my Swift project on my device, using Xcode 6.

设备运行的是 iOS 7.1,而我的 Mac 运行的是 Mavericks.

The device is running iOS 7.1, and my mac is running Mavericks.

我用 Swift 和 SpriteKit 编写了一个小游戏,它可以在模拟器中运行,但是当我尝试在我的设备上运行它时,我收到一条警告,我的设备只显示黑色背景.

I have written a little game in Swift and SpriteKit, and it works in Simulator, but when I try to run it on my device, I get a warning, and my device only shows a black background.

尝试运行新的 SpriteKit 项目时得到相同的结果.但是如果我使用 Swift 运行一个新的单页应用程序,它会正常运行.

I get the same result when trying to run a fresh SpriteKit project. But if I run a fresh Single Page Application using Swift, it runs normally.

这是我收到的警告:

有什么建议吗?

推荐答案

我也遇到了这个崩溃,与 7.1.1 SDK SpriteKit 游戏模板相比,它似乎与从 加载场景有关.sks 文件.

I also got this crash and, comparing to the 7.1.1 SDK SpriteKit game template, it appears to be related to loading the scene from an .sks file.

我将其更改为使用不同的初始化程序,如下所示:

I changed it to use a different initializer like this:

let scene = GameScene(size: skView.bounds.size)

在那之后,模板项目不再在我的装有 iOS 7.1.1 的 iPad mini 上崩溃.但是,平面精灵不会被渲染.您可以看到节点数(在右下角)随着每次点击而增加,但精灵不可见.你好,世界!"标签显示正常,但...

After that, the template project is not crashing anymore on my iPad mini with iOS 7.1.1. However, the plane sprites don't get rendered. You can see the node count (on the bottom right corner) go up with each tap, but the sprites aren't visible. The "Hello, World!" label shows fine, though...

这篇关于Swift 和 Spritekit 无法在运行 iOS 7.1 的设备上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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