我在我的項目中創建了一個快速的操場。但是當我添加此關於在雨燕遊樂場UIImage
var img2 = UIImage(named : "Demo")
它給了我下面的控制檯輸出:
Playground execution failed: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x20). The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation. * thread #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
(anonymous namespace)::getImplementationForType(swift::Metadata const*, swift::OpaqueValue const*) + 247 frame #1: 0x00000001001a8416 libswift_stdlib_core.dylibswift_reflectAny + 198 frame #2: 0x000000010033d603 PlaygroundLogger
PlaygroundLogger.PlaygroundObjectWriter.encode_object (PlaygroundLogger.PlaygroundObjectWriter)(A, Swift.String) ->() + 707 frame #3: 0x000000010031ba5f PlaygroundLogger`playground_log + 319 frame #4: 0x000000010bafa174
我Images.xcassets添加的圖像。我可以在.swift文件中運行此代碼,但不能在我的.playground中運行。
我嘗試更改遊樂場設置中的資源路徑。只有「無」選項可以運行,別人給我的錯誤信息:
"Playground execution terminated because the playground process exited unexpected"
爲什麼這會降低投票率?對我來說這似乎是一個很好的問題。 – phatmann