On Tue, Oct 27, 2009 at 11:27 AM, Christian Ziegler <chris.zieg...@me.com> wrote: > I got an NSTableView binded to an NSArrayController (Values, Sort > Descriptors, Selection), which itself is binded to a class' NSMutableSet via > the ContentSet binding. The NSTableView is filled via Drag & Drop or > File/Open. For an initial insertion of data I set a sortDescriptor, but if > the user drags objects around in the NSTableView I remove the > sortDescriptors of the NSTableView by setting it to nil.
The fact that you have a sort descriptor set means the following will result in an NSArray being created somewhere. There's all sorts of magic (fast set proxies, slow set proxies, array proxies) that KVO presents based on what you're observing. I believe your code is starting out on the array path, but adding more things with no sort descriptor set triggers a change notification on your model object that KVO notices and therefore moves everything to the fast path, which provides no order information at all. NSTableView's binding support might notice this and not bother trying to reorder things, or it could try and KVO just silently drops the ball. Without the AppKit source it's hard to know exactly what's going on, but the conclusion is "You're Doing It Wrong." You're arbitrarily switching between having a concept of ordering and no concept of ordering. You need to always present an ordered collection to your table view so that you can respect its desire to move things around. --Kyle Sluder _______________________________________________ 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