【发布时间】:2014-06-06 10:05:12
【问题描述】:
我在我的项目中创建了一个快速游乐场。但是当我添加这个
var img2 = UIImage(named : "Demo")
它给了我以下控制台输出:
Playground 执行失败:错误:执行被中断,原因: EXC_BAD_ACCESS(代码=1,地址=0x20)。该过程已保留在 中断的地方,使用“thread return -x”返回 到表达式评估之前的状态。 * 线程 #1: tid = 0xac9f4, 0x00000001001a8797 libswift_stdlib_core.dylib
(anonymous namespace)::getImplementationForType(swift::Metadata const*, swift::OpaqueValue const*) + 247, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x20) * frame #0: 0x00000001001a8797 libswift_stdlib_core.dylib(匿名 命名空间)::getImplementationForType(swift::Metadata const*, swift::OpaqueValue 常量*) + 247 帧#1:0x00000001001a8416 libswift_stdlib_core.dylibswift_reflectAny + 198 frame #2: 0x000000010033d603 PlaygroundLoggerPlaygroundLogger.PlaygroundObjectWriter.encode_object (PlaygroundLogger.PlaygroundObjectWriter)(A, Swift.String) -> () + 707 第 3 帧:0x000000010031ba5f PlaygroundLogger`playground_log + 319 第 4 帧:0x000000010bafa174
我在 Images.xcassets 中添加了图像。我可以在我的 .swift 文件中运行此代码,但不能在我的 .playground 中运行。
我尝试在 Playground 设置中更改资源路径。只有 'None' 选项可以运行,其他的给我错误信息:
"由于 Playground 进程退出,Playground 执行终止 意外”
【问题讨论】:
-
为什么这被否决了?对我来说似乎是一个很好的问题。