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 7035011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:15:14+00:00 2026-05-28T01:15:14+00:00

In my app I have multiple UIButtons for which I add targets. It turns

  • 0

In my app I have multiple UIButtons for which I add targets.

It turns out that the most recently added target is preformed first and then the remaining targets.

For example, take this code:

[button addTarget:self action:@selector(someAction:) forControlEvents:UIControlEventTouchUpInside];

[button addTarget:self action:@selector(someOtherAction:) forControlEvents:UIControlEventTouchUpInside];

If I would touch up inside button, someOtherAction: would be called before someAction.

That’s not what I want. I want to sort the targets so that I can have a touch up inside of that button first called someAction:ability and then other action someOtherAction:

I’m not sure where to begin, should I subclass and override something in UIButton or rather dig inside UIControl?

Thanks for the help!

-David

  • 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-28T01:15:15+00:00Added an answer on May 28, 2026 at 1:15 am

    The simplest (albeit hacky) way to do this would be to make a copy of all the action selectors, remove them from the target then re-add all of them except the one you want to have happen first.

    However, your requirements are likely a side-effect of a poor design decision since this isn’t behavior that should be necessary.

    What is your end goal of having something happen first?

    Why can’t you combine both actions in one that executes the selectors in the correct order?

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

Sidebar

Related Questions

I am currently making an app that will have multiple timers, which are basically
I have multiple UIButtons in my app. I also use interfacebuilder. In my .h
We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies
I have an app that sends multiple Ajax requests simultaneously. I was originally running
I have CakePHP app in which I'd like to attach gallery to multiple resources.
I have a large Java app that is split up into multiple projects. Each
I have a single Rails 2.2.2 app that I want to 'share' with multiple
So, I have an asp.net mvc app that is being worked on by multiple
I have a situation with my MVC2 app where I have multiple pages that
Im building a Grails app that will have multiple similar websites (each it's own

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.