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 Objective-C Basics (Retired) Advanced Objective-C Dynamic Typing

Eduard Kim
Eduard Kim
607 Points

Don'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
Michael Pastran
4,727 Points

nil 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

Michael Pastran
Michael Pastran
4,727 Points

maybe your code is the following.

var thing: String?

thing = nil

1 Answer

Michael Pastran
Michael Pastran
4,727 Points

lol yeah your right. i didnt notice the Objective-C part.

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

That's fine, I'm glad to hear you willing to admit that.