Le 21 nov. 2010 à 21:39, Quincey Morris a écrit :

> It's not an ivar, it's a property.

You're perfectly right.

> You can't modify a NSSet. I suspect you mean "modify this relationship", but 
> the ambiguity leads me to wonder if you're trying to do something funky here. 
> Not that it's relevant to your actual question ...

I mean that I replace an entity in the set, so I add one new entity and I 
remove an old one via the appropriate mutators (-addEntityObject, 
-removeEntityObject).

> under the heading "General Guidelines". If I understand your scenario 
> correctly, you've been using approach #3, the one labeled "This approach is 
> strongly discouraged".

Exactly, that's why I want to change. Note that my needs are fairly basic, so I 
didn't see the point of entering into a more complex scheme.

> Use approach #1 (except in the unlikely case that performance is an issue 
> without full concurrency, in which case use approach #2).

I know I should have two MOCs, but that leads to further difficulties linked to 
mutator use. I see fairly clearly how to get a copy of the root entity (the one 
that has the NSSet *), but how about the entities at the other end of the 
relationship? Should I enumerate all those to get copies, and then perform the 
mutation on the copies? Can I directly mutate the set from the root copy object 
without making this expensive copying operation? Is the change immediately 
reflected in the other MOC (I need real time interaction), etc.

Thanks for answering, have a nice Sunday!
Vincent_______________________________________________

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