Playground misbehaving (Chapter 3)

I’m trying to work through the examples in this chapter but the playground is somewhat erratic in its behaviour. Sometimes a typo or partially completed line of code triggers an error message in the editor and then the playground hangs - the only way to get up and running again is to quit Xcode and run ./boostrap.sh (although it sometimes takes one or two attempts to clear any errors relating to missing source files).

Any pointers gratefully received!

You seem to be getting further than I am. As soon as I run the playground I get a bunch of “error: Couldn’t lookup symbols:” messages.

I’ve got a feeling it’s related to introspection / reflection which Swift isn’t overly good at (I found Java a lot more reliable). I’m still a relatively inexperienced iOS developer and the stack trace is even more incomprehensible than normal!

@gilroykilroy i seem to be having the same problem as you. Have you found a solution?

No solution. I think Apple needs to do a better job of supporting playgrounds that use third party frameworks.

Not all of the Playgrounds misbehave if that makes you feel any better. I’ve now completed the book and generally most of them work pretty well with the odd glitch resolved by running the bootstrap command again after closing Xcode.

Same to me. My solution is git clone https://github.com/realm/realm-cocoa.git, drop playground( in the book) into RealmExamples.xcworkspace.

To get this Playground running do the following:

  1. In the scheme selector choose RealmSwift > iPhone 6s
  2. Press Cmd + B
  3. If the Playground didn’t already run press the :arrow_forward:︎ button at the bottom

This seems to be an issue with Xcode 9.3 and playground. A lot of people reporting crashes. Although you didn’t say which Xcode you are running so maybe not related.

Sorry - should have said. It is Xcode 9.3. Hopefully it will be rectified in the next point release

yeah, it really is an issue with Xcode 9.3/CP - we’re working on the solution right now :+1:t3:

Heya ! Please look at the solutions outlined in the other thread:

Regardless, we’ll be releasing a new version which fixes this soon!