Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
John Judge3,527 Points
EXC_BAD_INSTRUCTION when clicking button in simulation.
^ This pops up after I've pressed the button and the app crashes. Followed by (code= EXC+i386_INVOP, subcode=0x0)
The line it appears on is //playlistCoverImage.image = playlist!.largeIcon
When I look at the var in the Playlist.swift file it highlights the name of the variable.
Maybe there is a wrong constrain with the storyboard file. Or you can just try to clean the build by command + k + shift. Are you sure that all files are in the right place? Seems like you've forgotten to add the largeIcon image to your project. If all doesn't work just download the project files from the latest tutorial and compare them to yours.
John Judge3,527 Points
It's weird. I've followed all of the instructions, and definitely added the image to the project - the smaller icon shows up and in the assets folder all of the images show up there. I'm not sure where the disconnect here is, but the clean build did not work. I've downloaded the teacher copy and checked everything and it all looks the same. I'll just move forward, but it would be really nice to be able to learn from whatever mistake I've made. Thanks for your help!
I have the same error and I don't know what seems to be the issue. My code seems to go into the
if playlist != nil, but that's it.
When I press the "Press Me" button in the simulator, I get a "fatal error: unexpectedly found nil while unwrapping an Optional value" error, and the segue doesn't transition to the Detail View Controller.
Ga-eun Kim2,558 Points
I even copy and pasted the teacher copy, but it's still not working, and the same error (EXC_BAD_INSTRUCTION) shows up. Is there something wrong with my story board settings??
Eduardo Pinheiro4,649 Points
Check to see if you've named your outlets correctly. I had named one of them palylistArtist0 instead of playlistArtist0 and I got the same fatal error.