Attempt to fix a strange crashing bug caused by accessing self.entity.relationshipsByName, which is a specialised NSDictionary subclass with fixed keys.
To workaround, make a copy in a standard NSDictionary.