ios – what does Error Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) mean?

ios – what does Error Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) mean?

This line

secondNumber = Screen.text!.toInt()!

means: Get the Screen object, get the text property and please crash if it doesnt exist, then get the text converted to an integer, and please crash if it doesnt exist.

Thats what the ! means: I am sure this thing exists, so please crash if it doesnt. And crash is what it did.

Generally, EXC_BAD_INSTRUCTION means that there was an assertion failure in your code. A wild guess, your Screen.text is not an integer. Double check its type.

ios – what does Error Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) mean?

Mine was about

dispatch_group_leave(group)

was inside if closure in block. I just moved it out of closure.

Leave a Reply

Your email address will not be published.