Re: NSOutlineView multi cell type binding query
Re: NSOutlineView multi cell type binding query
- Subject: Re: NSOutlineView multi cell type binding query
- From: "email@hidden" <email@hidden>
- Date: Tue, 5 Oct 2010 23:36:41 +0100
On 5 Oct 2010, at 23:03, Quincey Morris wrote:
> On Oct 5, 2010, at 03:53, email@hidden wrote:
>
>> However it appears that the binding machinery causes the NSPopUpButtonCell selection to be reset after the user has interacted with the control.
>>
>> I therefore have to resync the NSPopUpButtonCell selection to the model in - outlineView:willDisplayCell:forTableColumn:item:
>
> If I understand you correctly, then it's not the binding machinery that "resets" anything.
>
> Instead, it's understood (as part of NSTableView's API contract) that the cell in outlineView:willDisplayCell:forTableColumn:item: is re-configured every time it is used, since it's potentially re-used for multiple rows. It's not surprising that you would have to set up the selected item(s) every time.
>
> Or did I misunderstand what you're asking?
Quincey
I probably didn't clarify the issue enough, sorry.
I have a separate NSPopUpButtonCell that I recycle and configure as and when required.
The issue is that when the NSPopUpButtonCell is selected and the user selects an item from the popup NSMenu the user's selection is reset.
ie: say the user selects item 3, when the NSMenu is dismissed the NSPopupButtonCell is reset to display item 1.
In the action method the NSPopupButtonCell selected item is correct (item 3) and I update my model accordingly.
It is after this that the NSPopupButtonCell selection is reset.
I have to nudge it back to the required model state in - outlineView:willDisplayCell:forTableColumn:item:
I can only assume that the binding machinery that is servicing the NSValueBinding on the NSTextFieldCells is futzing with my NSPopupButtonCell.
Regards
Jonathan Mitchell
Developer
Mugginsoft LLP
http://www.mugginsoft.com_______________________________________________
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