Another relationship problem
Another relationship problem
- Subject: Another relationship problem
- From: Todd Ransom <email@hidden>
- Date: Sat, 7 May 2005 23:18:41 -0600
Because of the bug that prompted my last email I have realized that I
need to clean up relationships between objects whenever an object is
deleted from a document in my application. I am trying to do this once
in my base class using KVC but I have run into a major problem.
Most relationships are fine because they are many-to-many and I can
simply remove the object I'm about to delete from the array on the
other side of the relationship. But I have one relationship which is
causing me grief - a one-to-many relationship between chapters and
scenes in the novel writing software. A chapter has many scenes but a
scene is assigned to only one chapter. So when I try to delete a
chapter I look at the inverseRelationshipForKey:, get back the scene
and the key that needs to be deleted, and throw an exception when I try
to call setValue: nil forKey: theKey.
Is there any way to blank out the value of a key using KVC or do I have
to hard-code relationship removal in all of my model objects?
Todd Ransom
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden