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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:43:31+00:00 2026-05-31T02:43:31+00:00

I have a view with some images. I want to know which image I

  • 0

I have a view with some images. I want to know which image I selected. If I select an image, it will come to same method if I select another image.

On every image I select the "touchesEnded:" method is executed.
Is there away to differ between the images?
Any help will be appreciated.

  • 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-31T02:43:32+00:00Added an answer on May 31, 2026 at 2:43 am

    Try to enymerate throught all views:

    - (void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
    {
    // Enumerate through all the touch objects.
        for (UITouch *touch in touches)
        {
            //Enumerate through all subviews
            for (UIView *subView in [self.view subviews])
            {
                if (CGRectContainsPoint([subView frame], [touch locationInView:self.view]))
                {
                    //Found touched view
                    /*Optional: you can set to each UIImageView tag and check it here
                    switch (subView.tag)
                    {
                        case 1:
                            break;
                        case 2:
                            break;
                        default:
                            break;
                    }
                    */
                }
            }
         }
     }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Class which Extends View I'm able To Move one Image Over another
When I have a table view with some sections which have their own headers
I want to launch a new fragment to view some data. Currently, I have
I have a thread which performs some tasks. At the end I want to
let's say I have an image http://.../images/1.jpg and I don't want people to see
I have a table view and it is populated by some data. I want
I have an app widget which displays some rss feeds.It contains a text view
I have a some code that changes the background image of a cell which
I have a NSTextField which is nested by a custom view and I want
I have a custom baseadapter which does some lazy loading of some images, and

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.