我在我的项目中创建了一个快速的游乐场。但是当我添加这个
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 const*) + 247 帧#1: 0x00000001001a8416 libswift_stdlib_core.dylibswift_reflectAny + 198 frame #2: 0x000000010033d603 PlaygroundLogger
PlaygroundLogobjectLog (PlaygroundLogger.PlaygroundObjectWriter)(A, Swift.String) -> () + 707 帧 #3: 0x000000010031ba5f PlaygroundLogger`playground_log + 319 帧 #4: 0x000000010bafa174
我在 Images.xcassets 中添加了图像。我可以在我的 .swift 文件中运行此代码,但不能在我的 .playground 中运行。
我尝试在操场设置中更改资源路径。只有“无”选项可以运行,其他选项给我错误信息:
“操场执行终止,因为操场进程意外退出”