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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:20:24+00:00 2026-05-13T13:20:24+00:00

The user can create a unlimited number of UIImageViews with a button press with

  • 0

The user can create a unlimited number of UIImageViews with a button press with this code:

- (IBAction) addPicture:(id)sender { 
    imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0, 45.0, 324, 52.0)]; 
    imageView.tag = a;
    imageView.image = [UIImage imageNamed:@"Picture.png"];
    a = a + 1;
    [self.view addSubview:imageView]; 
    [imageView release];
}

So the first UIImageView gets the tag 1 and the second 2 and so on… Now how can I find out, which UIImageView was select by the user with a touch? I think, I have to do this in touchesBegan, but as I said, I don´t know how to get the right UIImageView.

For example in my app-idea the user can create images with a button and then he select a picture with a touch and can move it and resize it.

Thanks for your help.

  • 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-13T13:20:24+00:00Added an answer on May 13, 2026 at 1:20 pm

    Instead of using tag of UIImageView, why don’t you create your own subclass of UIImageView?
    You can overwrite touchesBegan method in the subclass, so you can detect a touch.
    Then in the subclass, you can move or resize a picture which the subclass has.

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

Sidebar

Related Questions

I want create a UIImageView with a button press. I did this with: -
On this system a user can create a quiz of any number of questions,
On my site a authorized user can create a content type called protocol. This
my goals (this is for training purpose): User can create(50%DONE)/edit/delete/view a created Quiz! The
How can I programmatically spawn an unlimited number of UIImageViews on to the screen
I'm working on this project that an admin user can create some User's Groups
I have a form where users can create unlimited number of rows (using jquery-
I have this relationship where User can create a document(trip) and invite other users
A user can create a post. Posts have comments. A comment must belong to
In my application user can create post,however only the creator of the post can

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.