On 11-Feb-09, at 12:16 PM, I. Savant wrote:

 How? What does this declaration look like in your classes? I assume
you have at least one custom subclass of NSManagedObject specified
(for your "Element" entity), based on the code example you gave, but
it's important to let us know *how* this is declared.

Indeed it is defined in a subclass of NSManagedObject as:

@property(readonly, retain) NSSet *elements;

It is read only as writing is done via KVC patterned write accessors (i.e. addElementsObject, removeElementsObject).

The implementation does nothing more than:

@dynamic elements;

I'm now defending against the wrong type of receiver representing the relationship by first sending a -count message and only if this is non- zero sending -allObjects. This seems to be working, though it's an unsatisfactory band-aid applied without true knowledge of how the circumstance is arising.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to