Search code examples
iosswiftrealmcocoapods

Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) Relm


I am using a Realm database in my iOS project. My build is always successful but when app runs in the simulator, it generates the above exception at initialization of the Realm object.

import UIKit
import RealmSwift

class ViewController: UIViewController {

    let realm = try! Realm()

    override func viewDidLoad() {

    }
}

Solution

  • I have faced that error and I did following steps
    1)Just rebuild the project
    2)Restart the xcode
    3)changed my simulator
    app started working correctly.