selectedObjects = ((ERDPickPageInterface)sender).selectedObjects();
} else {
selectedObjects = (NSArray)sender.valueForKeyPath("selectedObjects");
}
NSArray relatedObjects = (NSArray)eo.valueForKeyPath(relationshipName);
for(Enumeration e = relatedObjects.immutableClone().objectEnumerator(); e.hasMoreElements(); ) {
EOEnterpriseObject relatedObject = (EOEnterpriseObject)e.nextElement();
EOEnterpriseObject pickedObject = (EOEnterpriseObject)relatedObject.valueForKey(pickRelationshipName);
if(!selectedObjects.containsObject(pickedObject)) {
eo.removeObjectFromBothSidesOfRelationshipWithKey(relatedObject, relationshipName);
ec.deleteObject(relatedObject);