Re: Bindings not staying in sync when using NSPopUpButton selectItemWithTitle
Re: Bindings not staying in sync when using NSPopUpButton selectItemWithTitle
- Subject: Re: Bindings not staying in sync when using NSPopUpButton selectItemWithTitle
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 22 Sep 2004 18:22:27 -0700
Send -setSelectionIndex: to the relevant NSArrayController instead.
-jcr
On Sep 11, 2004, at 8:47 PM, Tod Cunningham wrote:
I am just wondering if this is a bug or by design for some reason. I
have a NSPopUpButton that is bound via cocoa bindings. When I change
the data it is bound to the popup works fine. However, if I change the
value of the popup via selectItemWithTitle the popup's value changes,
but the bound data doesn't get updated.
if( [bandPopUpButton itemWithTitle:[menuItem title]] != nil )
{
// Works find and the popup's value gets updated
[m_contact setBand:[menuItem title]];
// !! TC !! Why do I have to call setBand. If I just try to call
selectItemWithTitle
// the datamodel isn't getting updated.
//[bandPopUpButton selectItemWithTitle:[menuItem title]];
}
Thanks,
Tod Cunningham
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
http://developer.apple.com/cocoa/index.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden