Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 597479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:17:07+00:00 2026-05-13T16:17:07+00:00

So basically I have a big list of buttons that’s present dropdowns and other

  • 0

So basically I have a big list of buttons that’s present dropdowns and other things, and these buttons are created dynamically. So to capture the value for the appropriate button’s data, I need to set it’s action selector to a function that takes 1 extra parameter.

For example, using this selector on this dropdown, with the method below, returns an error that the selector is unrecognized. How can I get the selector to recognize the parameter I’m passing in? (In this case the variable ‘name’)

The apple docs at:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocSelectors.html#//apple_ref/doc/uid/TP30001163-CH23-SW1

On the last paragraph in the header ‘The Target-Action Design Pattern’, the Apple Docs imply that this can be done, but do not give an example of using a custom message, or maybe I’m just misunderstanding?

SEL sel = @selector(openDropdown:name:);
[dropdownSelector addTarget:self action:sel forControlEvents:UIControlEventTouchUpInside];


-(void) openDropdown: (NSString *) anotherArg : (id) sender {
 // Stuff here based on anotherArg
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:17:07+00:00Added an answer on May 13, 2026 at 4:17 pm

    You should be able to derive the clicked button’s information from the id input arg

        UIButton *button = (UIButton *) sender
         NSString *title = [button currentTitle];
    

    No need to pass the extra param

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a page which is basically just a big unordered list - sort
We have a big winforms C# application, that's basically a frontend for some databases
I have a relatively big SSIS package which I'm trying to edit. I basically
I have an automatically generated regular expression, which basically is one big or group
I basically have a program that filters records from one excel file to another
I basically have 7 select statements that I need to have the results output
I'm on the beginning of my Learn MVC way. Basically, I don't have big
I have a big chunk of my makefile (~50 lines) that needs to be
Basically I have 2 list with 'widgets' in each and some of them can
Basically I have these files (medline from NCBI). Each is associated with a journal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.