NSBatchUpdateRequest propertiesToUpdate using NSManObject?

Is it possible/allowed/supported to pass an NSManagedObject in the propertiesToUpdate dictionary of NSBatchUpdateRequest.
Code Block 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.
  • Does no-one on the CoreData team know the answer to this basic question??

Add a Comment