首页 > 解决方案 > 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() {

    }
}

标签: iosswiftrealmcocoapods

解决方案


我遇到了这个错误,我做了以下步骤
1)只需重建项目
2)重新启动 xcode
3)更改我的模拟器
应用程序开始正常工作。


推荐阅读