Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXC_BAD_INSTRUCTION DispatchQueue #38

Open
JohnDevC opened this issue Nov 10, 2016 · 0 comments
Open

EXC_BAD_INSTRUCTION DispatchQueue #38

JohnDevC opened this issue Nov 10, 2016 · 0 comments

Comments

@JohnDevC
Copy link

If I want to create an NSManagedObject in a background thread than EXC_BAD_INSTRUCTION (code=EXC_i386_INVOP, subcode=0x0) arise.

@discardableResult class func create(in context: NSManagedObjectContext = AERecord.Context.default) -> Self {
let entityDescription = NSEntityDescription.entity(forEntityName: entityName, in: context)!
let object = self.init(entity: entityDescription, insertInto: context) // error line Line 104 in Query.swift
return object
}

Part of my code:
DispatchQueue.global(qos: .background).async{
let model = Model.create()
}

Do you know what's going wrong?
Thank you for your efforts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants