I have a problem between iOS 8 and iOS 7. I am using Core Data, I have an entity called Pessoa
( NSManagedObject
), but when performing an update on the data happens a EXC_BAD_ACCESS
, only this, no further description or error.
It happens in the following section:
let batchUpdateRequest = NSBatchUpdateRequest(entityName: "Company")
Strange because iOS 8 usually works and updates the data.
The method code is basically:
func update (people: People) {
var error: NSErrorPointer = nil
//O erro ocorre aqui
let batchUpdateRequest = NSBatchUpdateRequest(entityName: "People")
batchUpdateRequest.predicate = NSPredicate(format: "idObject == \(people.idObject)")
batchUpdateRequest.propertiesToUpdate = [
"name" : people.name,
"phone" : people.phone,
"address" : people.address,
"email" : people.email
]
batchUpdateRequest.resultType = NSBatchUpdateRequestResultType.UpdatedObjectsCountResultType
let result = managedObjectContext?.executeRequest(batchUpdateRequest, error: error) as NSBatchUpdateResult
}
Already tried changing to:
let batchUpdateRequest = NSBatchUpdateRequest(entityName: "Company" as NSString)
But all to no avail.