I am beginning Swift and using tutorials in Swift playgrounds for macOS.
So example code would be
var str = "Hello, playground"
str
str1
I do not get any red error information on the str 1. Just a crash in the console
Playground execution failed: error: MyPlayground.playground:1:1:
error: use of unresolved identifier 'str1'
str1
^~~~
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
* frame #0: 0x0000000102157360 com.apple.dt.Xcode.PlaygroundStub-macosx`executePlayground
frame #1: 0x000000010215522a com.apple.dt.Xcode.PlaygroundStub-macosx`-[PlaygroundViewBridgeService execute] + 90
If I correct the code then the playground does refresh and show new data it is just not reporting the errors
How do I stop Xcode from crashing and behave as documented?
Xcode Version 8.3 (8E162) macOS 10.12.4
I've tried deleting all Xcode files (including the ones that it creates during a build) and reinstalling and using a different user
2) Go to: xCode preferences > General > "Issue Navigator Detail" > now boost the dropdown to 10 lines. Now you can see the whole message in the issue navigator! Save this answer. Show activity on this post.
Xcode also gives you an interactive LLDB debugger window, where you can type commands to query values and run methods. If it's visible, you'll see “(lldb)” in the bottom of your Xcode window. If you don't see that, go to View > Debug Area > Activate Console, at which point focus will move to the LLDB window.
You can use playgrounds in Xcode to quickly write some Swift code, experiment with new Swift syntax, or work on your Swift algorithms skills. Most of all, playgrounds in Xcode are a great way to learn Swift programming. In this tutorial, you'll learn how to get started with playgrounds in Xcode.
Actually a Playground does show the "red mark error on the left side of code" and there's also an automatic option to fix the error, just as regular Projects.
I had the same problem as you (red marks wasn't showing up on the left). What solved for me:
I'm on Xcode 8.3.2
Update: Same is valid for Xcode 9.0
In the issue navigator, right click the error -> open as quick look, then select it back to open as playground. It works for me.
File -> Playground Settings
check show live issues for source code
select show all issues radial button
Xcode was, in fact, as of 3/2017 showing errors inline in the playground, just as it does in a project when editing a file. This behavior changed in a recent update, though I don't see it documented. I assumed it was a bug introduced with the latest patch, or perhaps a default setting was changed that can be changed back.
Edit: In fact, I just opened a playground I created pre-patch, and errors show inline
Settings are
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With