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
Joyce Ryu
1,124 Pointsxcode storyboard build error
2016-02-01 17:10:23.880 코코커피[3356:272817] CUICatalog: Invalid asset name supplied: fatal error: unexpectedly found nil while unwrapping an Optional value (lldb)
i keep fail building and see this error. Does anyone know how to fix this?
1 Answer
Martin Wildfeuer
Courses Plus Student 11,071 PointsI am just guessing here, but I think you may be force-unwrapping an optional value that is supposed to return a string (image name) while using it in your UIImage initializer at the same time. However, force unwrapping returns nil, which results in a fatal error.
So, I think you might be doing something like this:
let image = UIImage(named: yourOptionalValue!)
Make sure imageName cannot be nil, for example with this guard statement:
guard let imageName = yourOptionalValue else {
print("No valid image name")
return
}
let image = UIImage(named: imageName)
Let me know if that helps! :)
Martin Wildfeuer
Courses Plus Student 11,071 PointsMartin Wildfeuer
Courses Plus Student 11,071 PointsSry, just realized that you wrote this was a build error. So your app does not even compile and run? This error sounded much like a runtime error to me...