• 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
changing target from radio button choice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changing target from radio button choice


  • Subject: changing target from radio button choice
  • From: Chris Garaffa <email@hidden>
  • Date: Mon, 13 Aug 2001 11:03:11 -0400

Hello,
I'm writing a Cocoa app that has an NSButton which reads from an NSTextField and adds an item to an NSPopUpButton.
The NSButton is referred to as addFuncButton, and the text field as functionName. The popup buttons are menu1 through menu4. Clicking addFuncButton calls a function defined as
- (IBAction)addFunc:(id)sender;
the code for addFunc: is currently:
[menu1 addItemWithTitle: [functionName stringValue] ];

I also have a NSMatrix of radio buttons. I need to have addFunc:'s target change based on which radio button is selected. Clicking on a radio button calls changeMenu: which is (i've simplified the if statement for my testing purposes):
int which=[sender selectedRow]+1;
if (which == 2)
[addFuncButton setTarget: menu2];
else
[addFuncButton setTarget: menu3];
However, clicking a radio button then clicking addFuncButton gives this error in PB:
Aug 12 18:19:47 Function Keeper[550] *** -[NSPopUpButton addFunc:]: selector not recognized
Aug 12 18:19:47 Function Keeper[550] *** -[NSPopUpButton addFunc:]: selector not recognized
(yes, it repeats itself).

Can someone help me out? TIA,

Chris


  • Prev by Date: Re: E-mail
  • Next by Date: Connecting to Database
  • Previous by thread: how to handle "rtsp" protocol??
  • Next by thread: Connecting to Database
  • Index(es):
    • Date
    • Thread