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

  • Home
  • SEARCH
  • 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 8824769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:42:58+00:00 2026-06-14T06:42:58+00:00

When the method that I am trying to link to my UIButton only has

  • 0

When the method that I am trying to link to my UIButton only has one parameter, then I am able to call addTarget and my code runs successfully when the button is clicked —

[ myDetailButton addTarget:self action:@selector(hideMap:) forControlEvents:UIControlEventTouchUpInside];

(void)hideMap:(NSMutableArray*)arguments

but if I add a second parameter to my hideMap method, I get an unrecognized selector error when calling it:

[ myDetailButton addTarget:self action:@selector(hideMap:) forControlEvents:UIControlEventTouchUpInside];

(void)hideMap:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options

I see this error no matter how I format the addTarget parameters, per this question —

action:@selector(hideMap)
action:@selector(hideMap:)
action:@selector(hideMap:event:)

How can I call a method that has multiple parameters using addTarget?

  • 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-06-14T06:43:00+00:00Added an answer on June 14, 2026 at 6:43 am

    You’re problem is you are giving a selector that is expecting an NSMutableArray as the input along with a dictionary. the UIButton does not agree with this. As per your post you linked to, a UIBUtton only agrees to sending either nothing, itself as an id, or itself and an event.

    I’m not 100% sure how you are expecting to get an NSMutableArray and an NSMutableDictionary from a UIButton callback, what is it exactly you are trying to achieve here, I might be able to suggest some help.

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

Sidebar

Related Questions

I'm trying to call a Sort method that expects a parameter of type IComparer<object>
I'm trying to devise a method that will be able to classify a given
I'm trying to invoke a method that takes a super class as a parameter
I'm trying to link my website with Facebook. If I call the method in
I am trying to have a method that takes in a username and will
I'm trying to write a method that will compute all permutations of a power
I am trying to write a method that adapts to different types of interfaces
I'm trying to write a method that removes all non alphabetic characters from a
I am trying to write a generic method that would bind any asp.net UI
I’m trying to write a regex/method that extracts Variables from an input String that

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.