3

Since updating to Xcode 6 beta 5 my playground code will no longer compile/run and logs:

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

It should be simple enough and worked fine on the previous versions. The only code I am running up to that point is as follows:

import Foundation
import UIKit
import XCPlayground
import QuartzCore
let frameRect: CGRect = CGRectMake(0, 0, 500, 500)
var customView = UIView(frame: frameRect)

Just wondering if anyone else is having problems with Playground and found solutions. My hunch is that is just a beta bug.

Shruti Thombre
  • 989
  • 4
  • 11
  • 27
jaco129
  • 127
  • 6

2 Answers2

3

You should use let rect = CGRect(x: 0, y: 0, width: 500, height: 500) instead.

CGRectMake still works for me though... Did you create a new playground with beta 5? I've found it's best to always create a new playground for each new beta.

Chris Wagner
  • 20,773
  • 8
  • 74
  • 95
  • No joy. That was my first thought but when I copied my code over to a new Beta 5 project the error remained. Also your code still logs the same error for me. I may try reinstalling the whole thing again since it is still working for you. Thanks! – jaco129 Aug 05 '14 at 20:20
  • 1
    Ick, beta 5 caused a lot of weirdness for me. I ended up having to blow away all of my derived data directories to resolve some framework issues. – Chris Wagner Aug 05 '14 at 20:28
  • Here's a fun development: if I don't import XCPlayground and remove the related code the whole thing runs smoothly, I just can't see the result... Which is kind of the idea of the playground. So that's fun. I'm going to go ahead and reinstall. – jaco129 Aug 05 '14 at 21:00
3

Try just removing the "make":

import Foundation
import UIKit
import XCPlayground
import QuartzCore
let frameRect: CGRect = CGRect(0, 0, 500, 500)
var customView = UIView(frame: frameRect)

Also, you may get another weird error with your view when you import XCPlayground, so try this:

customView.setTranslatesAutoresizingMaskIntoConstraints(true)
dcbenji
  • 4,598
  • 5
  • 21
  • 23