自从更新到Xcode 6 beta 5后,我的游乐场代码将不再编译/运行并记录日志:
Playground execution failed: error: Couldn't lookup symbols: _CGRectMake
它应该足够简单并且在以前的版本中运行良好。我到目前为止唯一运行的代码如下:
import Foundation
import UIKit
import XCPlayground
import QuartzCore
let frameRect: CGRect = CGRectMake(0, 0, 500, 500)
var customView = UIView(frame: frameRect)
只是想知道是否有其他人遇到Playground问题并找到解决方案。我的预感是这只是一个测试版错误。
答案 0 :(得分:3)
您应该使用let rect = CGRect(x: 0, y: 0, width: 500, height: 500)
代替。
CGRectMake
对我来说仍然有用...你创建了一个带有beta 5的新游乐场吗?我发现总能为每个新的测试版创建一个新游乐场。
答案 1 :(得分:3)
尝试删除“make”:
import Foundation
import UIKit
import XCPlayground
import QuartzCore
let frameRect: CGRect = CGRect(0, 0, 500, 500)
var customView = UIView(frame: frameRect)
此外,导入XCPlayground时,您的视图可能会出现另一个奇怪的错误,请尝试以下操作:
customView.setTranslatesAutoresizingMaskIntoConstraints(true)