I'm trying to use CoreData but whenever I try to store an object, I have been getting the EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) error. What might be causing this error? As a side note, I did not initially create my project intending to use CoreData so CoreData was something I added onto my project later (I don't know if this might be what's causing the problem).
lazy var managedObjectModel: NSManagedObjectModel = {
// The managed object model for the application. This property is not optional. It is a fatal error for the application not to be able to find and load its model.
let modelURL = NSBundle.mainBundle().URLForResource("repliaoutput", withExtension: "momd")!
return NSManagedObjectModel(contentsOfURL: modelURL)! //this line is where the EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) error is
}()