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 trialAndy Warr
2,417 Pointssqrt not working for me in Xcode?
I got through this final exam just fine, except Xcode is returning a "Use of unresolved identifier 'sqrt'" error in my set method.
I believe I used the correct syntax:
set { sideLength = sqrt(newValue) }
I can also use any other operators to come up with a different answer for the sideLength, which of course does not return the correct value, but the code works. Everything else in my code checks out with the solution video.
Anyone else seen this?
2 Answers
Andy Warr
2,417 PointsAh, never mind. I had accidentally deleted the
import UIKit
statement from the top of the playground. Will leave this up in case anyone else has this problem, unless the mods see fit to take it down.
Jarrett Young
12,635 PointsI'm getting the exact same error message, and I have the import UIKit statement at the top.