Swift iOS Playground:发送延迟道具时出错 [英] Swift iOS playground: Error sending deferral props

查看:17
本文介绍了Swift iOS Playground:发送延迟道具时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iOS Playground 设置如此简单:

With an iOS playground set up as simply as this:

import UIKit
import SpriteKit
import XCPlayground

let s = CGSize(width: 300, height: 300)
let f = CGRect(origin: CGPointZero, size: s)
let view = SKView(frame: f)
let scene = SKScene(size: s)
scene.backgroundColor = SKColor.redColor()
view.presentScene(scene)
XCPShowView("main view", view)

我在控制台中得到了这个:

I'm getting this in the console:

2014-09-04 17:02:13.358 SpriteKitBETA7[2009:20695] Error sending deferral props: 0x10000003

助手编辑器中有一个主视图"框,但它不显示任何内容.这个完全相同的代码(使用 import Cocoa 而不是 import UIKit)在 OSX 操场上完美运行.我知道我可以在 OSX 操场上测试东西(虽然在 iOS 上会更方便,因为我不想使用 Yosemite 但我确实有 iOS7 SDK)并复制粘贴到我的项目中,但我想知道是否有人明白这里发生了什么.

There IS a "main view" box in the Assistant Editor thing, but it doesn't display anything. This exact same code (with import Cocoa instead of import UIKit) works perfectly on an OSX playground. I am aware I can just test stuff in an OSX playground (though it would be more convenient on an iOS one since I don't want to use Yosemite but I do have the iOS7 SDK) and copy-paste to my project, but I wanted to know if anyone understood what's happening here.

推荐答案

根据 Xcode 6 Release Notes,你需要在File Inspector中启用Run in Full Simulator.请记住,由于它是通过 iOS 模拟器运行的,因此运行速度会很慢.在您的 XCPShowView 开始在 Playground 的时间轴中显示之前,您必须等待一段时间才能启动 iOS 模拟器.

Per the Xcode 6 Release Notes, you will want to enable Run in Full Simulator in the File Inspector. Keep in mind this will run kind of slow since it is running through iOS Simulator. You'll have to wait a while for the iOS Simulator to launch before your XCPShowView starts displaying in the playground's Timeline.

  1. Xcode 菜单栏中,转到 View > Utilities > Show File Inspector (++1)
  2. 在右侧的文件检查器中,在 Playground Settings 下,确保将 Platform 设置为 iOS
  3. 确保选中在完整模拟器中运行.
  1. In the Xcode menu bar, go to View > Utilities > Show File Inspector (++1)
  2. In the File Inspector on the right, under Playground Settings, make sure the Platform is set to iOS
  3. Make sure Run in Full Simulator is checked.

如果您将鼠标悬停在 在完整模拟器中运行 选项上,则说明您应该将其用于动画或使用 OpenGL 的视图.两者都适用于使用 SceneKitSpriteKit.

If you mouse over the Run in Full Simulator option it explains that you should use this with views that animate or use OpenGL. Both of which apply to using either SceneKit or SpriteKit.

这篇关于Swift iOS Playground:发送延迟道具时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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