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

Swift

Asger Mathiasen
Asger Mathiasen
4,801 Points

App Crashes: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

I get an error shortly after the app is launched - and i can't figure out why?

Some times the app gets the JSON data and sometimes it does not get the JSON data - but it will always crash after few seconds with the following error code:

EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

1 Answer

Jesus Cancino
Jesus Cancino
2,494 Points

Go over the Optionals Bindings section. Pretty sure you are using an explicit unwrapped Optional. Also check this stack over flow link. https://stackoverflow.com/questions/28804654/what-does-error-thread-1exc-bad-instruction-code-exc-i386-invop-subcode-0x0