Re: Getting the selected object from a popup button
Re: Getting the selected object from a popup button
- Subject: Re: Getting the selected object from a popup button
- From: Scott Anguish <email@hidden>
- Date: Tue, 4 May 2004 14:17:01 -0400
On May 4, 2004, at 12:00 PM, Joakim Danielson wrote:
Hello
I have three popup buttons, two text fields and a button to create a
search criteria against my database. Each popup is using
NSArrayController which is bound to an array in my controller class.
The problem is that I do not understand how to get the selected
object from the popup in my doSearch method.
bind a variable to the selectedIndex binding of the popupmenu.
then you can get the currently selected item by examining that
variable.
I've tried the following:
anObject = [transactionTypeList
objectInObjectArrayAtIndex:[transactionTypeArrayController
selectionIndex]];
but selectionIndex always return 0 or 1, depending on if I'm using a
null placeholder or not.
I also tried
anObject = [[transactionTypeArrayController selectedObjects]
objectAtIndex:0];
but it always returns the first object and not the selected object.
I must be doing something terrible wrong but right now I'm out of
ideas.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.