ios - 使用 XCPShowView 时为 "Playground execution failed"(标识符 : view:)

标签 ios uiview ios8.1 swift-playground

当使用 XCPShowView 时,Swift Playground 给了我

Playground execution failed: error: Couldn't lookup symbols:

 __TF12XCPlayGround11XCPShowViewFTSSCSo6UIView_T_

我使用 xcrun swift-demangle __TF12XCPlayGround11XCPShowViewFTSSCSo6UIView_T_ 查看 demangled 的名称是什么,它是

XCPlayGround.XCPShowView (Swift.String,ObjectiveC.UIView) -> ()

(虽然你可以通过阅读 __TF12XCPlayGround11XCPShowViewFTSSCSo6UIView_T_ 来了解 demangled 的名称是什么)

代码在这里

import UIKit
import XCPlayGround

let modelView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 375.0, height: 667.0))

XCPShowView("modelView", modelView)

怎么了?

最佳答案

该模块称为“XCPlayground”,而不是“XCPlayGround”。符号查找区分大小写。在标准 HFS+ 文件系统上,导入可能区分大小写,因此这可以解释导入有效但找不到符号的原因。尝试将其更改为“XCPlayground”,看看是否可以解决问题。

关于ios - 使用 XCPShowView 时为 "Playground execution failed"(标识符 : view:),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28393858/

相关文章:

ios - 从 UITabBarController 应用程序中的另一个 UIViewController 调用 UISplitViewController

ios - UIView 子类的大小取决于设备

ios - CoreData PersistentStorage 创建文件失败

xcode6 - ld : building for iOS Simulator, 但链接到为 MacOSX 文件 'RemObjectsSDK.framework/RemObjectsSDK' 构建的 dylib,适用于架构 i386

ios - 通过自动布局在 UIScrollView 中使用顶部布局指南

ios - UITableViewController : "Popovers cannot be presented from a view which does not have a window. "

ios - UIKit Dynamics - 缓慢移动的物体不会反弹

ios - 如何使 View 始终在应用程序的屏幕上可见?

iphone - UIView 总是在最前面

ios - IOS中的导航栈管理