• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting the selected object from a popup button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Getting the selected object from a popup button (From: Joakim Danielson <email@hidden>)

  • Prev by Date: Re: Objective-C question
  • Next by Date: Re: Objective-C question
  • Previous by thread: Getting the selected object from a popup button
  • Next by thread: Re: Lost Main Menu (was bug in IB ?)
  • Index(es):
    • Date
    • Thread