Le 12 avr. 2010 à 23:17, Quincey Morris a écrit :

> I think I'm confused now about what scenario we are talking about. Are you 
> saying that the object you insert with [NSArrayController insertObject...] is 
> *not* a NSManagedObject, but is a proxy object that is linked to the 
> NSManagedObject? Or are you referring to the NSArrayController itself as a 
> proxy object?

Forget that story of proxies that was a botch. I reverted to the first scheme, 
followed your idea to implement a NSNumber attribute and a sort predicate. 
Well, it took me a whole day to figure out a clean algorithm to handle the 
renumbering caused by the drag-and-drop operation, but it works now, and is not 
plagued by any side effect anymore.

If you want to know a bit more, the managed object represents a "geographical 
data layer" (e.g.: roads, buildings, rivers, etc.). The user selects which gets 
drawn first, then which gets drawn over the first, etc. up to the highest 
layer, that lies atop all the others. This "ordered stack" is displayed on 
screen through a NSCollectionView whose contents observe the NSArrayController 
arrangedObjects. The user can drag and drop the NSView in the NSCollectionView 
to modify the drawing order.

Thanks a lot for your precious help, you and Kyle.

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