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
kevin11
2,535 PointsWhy is Xcode prompting me to unwrap?
I have been following the tutorials for iOS Development. I copied the code over exactly how Pasan did. Like this:
let largeIconName = playlistDictionary["largeIcon"] as String!
But, an error comes up stating the following:
'AnyObject?' not convertible to 'String!'; did you mean as! to force downcast?
Why am I getting this error and Pasan is not in his tutorial when he has the same exact code? Is there a problem in my code somewhere else? I am unsure if it will affect the performance in the future of my app.
Please help.
Thanks in advance.
1 Answer
Chris Stromberg
Courses Plus Student 13,389 PointsPasan may have produced this video with an earlier version of Xcode. There is a good post on the swift blog covering this very topic.
kevin11
2,535 PointsThanks Chris. This explains the problem I was having and what to do. Thanks again.
Laurens Van Lieshout
1,892 PointsLaurens Van Lieshout
1,892 Pointssame problem here...