Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift Getting Started with Xcode Recap of Swift Basics

Scott Holmes
Scott Holmes
961 Points

Xcode: No error displayed when altering a constant

In Xcode playgrounds, I now don't see red flags when I change a constant. e.g.

let x = 1 

x = 2 // should display an error

>> changing x should give me an error, but no error shows in Xcode 

The issue only started yesterday- anyone else having issues with Xcode not displaying error warnings in a playground or project?

-So far I restarted Xcode, the computer,and  checked for updates.
Scott Holmes
Scott Holmes
961 Points

To be precise, the error will show in the console output when Assistant Editor is on, but no red error sign is shown to the left of the number lines in the Xcode Workspace window.

Scott Holmes
Scott Holmes
961 Points

I asked some developers at a iOS meetup. They said it may be due to the latest Xcode update. They suggested filing a bug report with Apple.

3 Answers

Scott Holmes
Scott Holmes
961 Points

Issue is resolved.

Solution: Update to Os X Yosemite, Update Xcode.

Hi Scott,

When you go into the playground, are there values in the Playground output area to the right of the playground code?

You may need to go to "Editor" in the xcode bar at the top of the screen, and choose "Execute playground". If you have input the (intentionally wrong) code as above, the values to the right should be greyed out, and the error message you are hoping for should be on the left.

Is that of any help?

Daniel

Scott Holmes
Scott Holmes
961 Points

The advice is helpful, thank you.

The red error display worked once, but I cannot replicate it. The values to the right are just as you described- greyed out. I will continue to see what the issue is. I am also going to a IOS meet up to see if anyone else has encountered the problem. Sue commented below that she also is encountering the issue.

Same problem here. Editor, Execute Playground does not help. In Xcode 6.0.1 I have to have the Assistant Editor open to see the execution error. It does not give me a red error notification in the left hand gutter unless I introduce a syntax error.

Scott Holmes
Scott Holmes
961 Points

I also have Xcode 6.01 and the error displays under the same conditions you describe. Syntax errors (like leaving out braces in a for loop) result in red error flags to the left of number lines in Xcode. Other types of errors, like reassigning a constant, do not yield red flags.