I'm trying to change a Bool property and am receiving an EXC_BAD_ACCESS error.
I'm using XCode 6 and Swift.
The note
property saves fine but the completed
property throws the EXC_BAD_ACCESS
error
import Foundation
import CoreData
class Task: NSManagedObject
{
@NSManaged var note: String!
@NSManaged var completed: Bool
}
Changing out the property routine
// taskObject is an instance of Task()
// Set the completed flag
taskObject.completed = true // EXC_BAD_ACCESS
You can use a swift Bool
with an NSManagedObject - no need for the NSNumber
nonsense. But you need to make sure that in the core data editor, the class is not empty. Enter your objects' name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With