Is it possible/allowed/supported to pass an NSManagedObject in the propertiesToUpdate dictionary of NSBatchUpdateRequest.
obj-c
MYManObjType* manObj = myManObject;/*Fetched using the same moc*/
NSBatchUpdateRequest* updateRqst = [NSBatchUpdateRequest batchUpdateRequestWithEntityName:@"relatedManObj"];
updateRqst.predicate = someValidPredicateDefinedElsewhere;
updateRqst.propertiedToUpdate = @{@"myManObjRealtionship":manObj};
updateRqst.resultType = NSUpdatedObjectsCountResultType;...
updateRqst.affectedStores = @[self.moc.persistentStoreCoordinator.persistentStores];
NSBatchUpdateResult* result = [self.moc executeRequest:updateRqst error:&err];
I keep getting this error:
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid relationship ...
But the relationship IS valid, and the 'assigned' object is of the correct type.
1
0
801