code=exc_i386_invop subcode=0x0 nib xcode7.2

77 views Asked by At

I have created a custom cell through nib and applied some constraints on it. Moving forward, I replaced that nib file with some old state of nib by replacing it in finder. Also all outlets and constraints are removed; Means, there is no any constraints and outlets now present. After running the code, exception and crash is coming.

code=exc_i386_invop subcode=0x0

Afterwards, i removed all the things in nib file; Now nib is entirely empty. I have double checked, no any outlet attached with that nib.

I am sure, something happen with copying and pasting the nib; Now i have to remove the nib file, and create new nib file then it will work again.

Please let me know if anyone also faced this type of problem?

1

There are 1 answers

0
msmq On

I have found the solution; As i copy and past the content of xib file from one xib to another xib, there is possibility that in next xib's .swift file contains any @IBOutlet that is not present in copied xib file;

For Example:

@IBOutlet var profilePicture: UIImageView!
@IBOutlet var coverPicture: UIImageView!
@IBOutlet var personName: UILabel!
@IBOutlet var jobTitle: UILabel!
@IBOutlet var currentLocation: UILabel!

There all outlets are non-optionals; So if anyone of them not linked in xib file, then at run time app will crash; So have to double check for IBOutlets; So that the outlets which are not used in .swift file, you need to remove them or make them optional with '?' keyword.