Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
- Subject: Re: Binding multiple NSTableView and NSPopupButton to an NSArrayControler
- From: Quincey Morris <email@hidden>
- Date: Mon, 02 May 2011 10:03:44 -0700
On May 2, 2011, at 08:02, Lorenzo Thurman wrote:
> I have an NSPopupButton whose content is bound to an NSArrayController's (controller A) arrangeObjects controller Key. This NSArrayController is bound to an NSMutableArray which holds the items for display. The contents of the NSPopuButton display as expected.
>
> In another XIB (NSWindowController subclass), I have an NSTableView whose only column's value is bound to an NSArrayController's (controller B) arrangedObjects. This NSArrayController resides in the same XIB as the NSTableView and is bound via an NSObject proxy in that same XIB to the same NSMutableArray as controller A. These items display as expected in the NSTableView. I can remove an item from the NSTableView, and in the debugger, I can see that the item is indeed removed from the NSMutableArray. But when I save the array on quitting the application, I see the removed item has somehow made it back into the array.
This is a little bit clearer, but still to vague to be of much use.
The short answer is that it sounds like you have 2 mutable arrays underlying all of this. After you've checked the item removal in the debugger, you should check in the debugger again at save time that it's the *same* array you're saving, rather than a duplicate that hasn't had the item removed.
I have no idea what "bound via an NSObject proxy in that same XIB to the same NSMutableArray as controller A" means. I'm also not sure, when you say "bound", you are always referring to an actual binding, or sometimes to an outlet connection.
To solve this, we need to to know all of the bindings, including (for each one): the object that's bound from; its location (in nib or created programmatically); the binding name; the object that it's bound to; *its* location; the property key that its bound to.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden