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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:40:44+00:00 2026-05-28T00:40:44+00:00

I have looked on here and found a few examples but nothing works so

  • 0

I have looked on here and found a few examples but nothing works so here goes…
I have a subview which is started and works fine, the camera takes a pic and then a thumbnail appears at the bottom right, when clicked I want the subview released but no matter how I try I can’t get rid of the subview!

Code:

    -(void)onSingleTap:(UITouch*)touch {
NSLog(@"onSingleTap");
    UIImageView *eyes = [[[UIImageView alloc] initWithImage:[UIImage     imageNamed:@"binocs.png"]] autorelease];
eyes.tag = EYES_TAG;
    [self.overlayView addSubview:eyes];
    [camera takePicture];
    }

Then the thumbnail action:

    - (void)thumbnailTapped:(id)sender {
    self.view.alpha = 99.0f;    
    UIButton *binocsButton = (UIButton*)[self.view viewWithTag:BINOCS_BUTTON_TAG];
binocsButton.hidden = YES;

    }

So my subView is called eyes and I just need to clear that view under the thumbnail tapped action. Any ideas would be fantastic!

  • 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-28T00:40:45+00:00Added an answer on May 28, 2026 at 12:40 am

    I’m not sure I follow entirely, but don’t you just want to add this to the bottom of thumbnailTapped::

    [[self.view viewWithTag:EYES_TAG] removeFromSuperview];
    

    By the way, rather than using tags it’s probably better to store a reference to the views that you want to access as an ivar of your view controller class. I would add this to your property definitions:

    @property (nonatomic, retain) UIImageView *eyes;
    @property (nonatomic, retain) UIButton *binocsButton;
    

    Then synthesise them and when you create those objects, assign to the properties and then you can access them easier later. Using tags I found in the past gets quite annoying as if the view is at the bottom of a complex view hierarchy you can’t access it easily. If you do do this, remember to also release them in your dealloc (unless you’re using ARC).

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

Sidebar

Related Questions

I have looked on here and anddev for a suitable response, but haven't found
I have looked at a lot of answers but have not found a satisfactory
I looked around here and found nothing so I'll ask it here. How do
have looked through many posts here on SO, and haven't found any that address
I have looked for this in several places but not necessarily found the right
I have looked at the documentation here: http://docs.python.org/dev/library/xml.etree.elementtree.html#xml.etree.ElementTree.SubElement The parent and tag argument seems
I have looked through and couldn't find the answer on here... We are doing
Composer is a PHP package manager. I have looked through the documentation here: http://getcomposer.org/
Have looked quite hard for this answer but having no luck. I have 3
I have looked all over the MySQL website and found no definitive answers. Is

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.