In a window displaying a "widget" object I am using an outlineview bound to an NSTreeController as master view. When I notice the OV selection change via outlineViewSelectionDidChange I filter a tableview bound to an NSArrayController in one of two ways like so...

Method 1 :: use setFilterPredicate on the NSArrayController and set to a new NSPredicate Method 2 :: In IB bind the NSArrayController's Filter Predicate to a property called myPredicate and use KVC to set a new NSPredicate

Either of these methods work fine - the tableview's content filters fine. The problem I am having is that when I load a new widget, thus releasing the current widget view from the window, along with it's NSViewController, I get the error...

Cannot remove an observer <_NSArrayControllerExtensions 0x12c8b30> for the key path...

I have googled and found this is typically to do with non KVO compliant models. I have checked and rechecked my models and made sure that all properties are compliant with KVO. While debugging I removed resetting the NSPredicate in outlineViewSelectionDidChange and instead just set it once in awakFromNib and the issue goes away. This brings me to the conclusion that somehow resetting the NSPredicate for the NSArrayController is not allowed.

How should I go about filtering my tableview? Should it be okay to reset the NSArrayController's filterPredicate... ie is there something else going on?

Thanks in advance for any suggestions.
_______________________________________________

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