0
I have a problem between iOS 8 and iOS 7. I am using Core Data, I have an entity called Pessoa
(NSManagedObject
), only when doing a data update happens a EXC_BAD_ACCESS
, only that, no other description or error more.
It happens in the following section:
let batchUpdateRequest = NSBatchUpdateRequest(entityName: "Company")
Strange because in the iOS 8 works normally and updates the data.
The code of the method 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
}
I tried to change it to:
let batchUpdateRequest = NSBatchUpdateRequest(entityName: "Company" as NSString)
But all without success.