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 trialEduard Kim
607 PointsDon't really understand how explicitly declare id object to nil Here is what I write id thing = nil ;
Cannot see how this is wrong
Michael Pastran
4,727 Pointsmaybe your code is the following.
var thing: String?
thing = nil
Caleb Kleveter
Treehouse Moderator 37,862 PointsMichael,
remember, this is Obj-C, not swift.
1 Answer
Caleb Kleveter
Treehouse Moderator 37,862 PointsMake sure there is no space between nil and semi-colon.
Michael Pastran
4,727 Pointslol yeah your right. i didnt notice the Objective-C part.
Caleb Kleveter
Treehouse Moderator 37,862 PointsThat's fine, I'm glad to hear you willing to admit that.
Michael Pastran
4,727 PointsMichael Pastran
4,727 Pointsnil can only be used if you are saying its an optional. what error is it giving you? the question is kind of ambiguous. also i doubt theres a keyword "id" or at least i haven't seen it in swift. lol i could be wrong