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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:34:13+00:00 2026-06-12T06:34:13+00:00

For some reason, I can’t seem to remove a UIImageView without removing all of

  • 0

For some reason, I can’t seem to remove a UIImageView without removing all of my UIButtons as well. All subviews were added to my main view _ourView and UIButtons were not given a tag (default 0) and my image was given a tag=5.

When I call

NSInteger o = [obj intValue]; //This is the letter "O" not 0, and o = 5 in this case (which is what my subview tag is)
UIView *hangmanView = [_ourView viewWithTag:o];
[hangmanView removeFromSuperview];
[_ourView setNeedsDisplay];

All of my buttons also disappear.

Any pointers?

EDIT: I have uploaded my project to github if you want to see more code. Here is the link to the file: https://github.com/elayman/Hangman/blob/master/Hangman/HangmanViewController.m#L172

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

    0 is the default for tag… so it takes the first view without a tag and that’s probably not what you want.

    Log what you remove so you can see what actually happens:

    NSLog(@"removing %@", hangmanView)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason i can't get the variable 'total' to define at all... I
For some reason I can't seem to get this particular web page's contents via
For some reason I can't seem to get the basic example to work, provided
For some reason I can't get this to work at all. I have read
For some reason i can't seem to get this right ok i have 2
For some reason I can't get something to work. All I want to do
For some reason I can't seem to call my global template function in GCC
For some reason I can't seem to use non-capturing groups in MySQL. Is there
For some reason I can't seem to catch the WM_LBUTTONDOWN event on a label
For some reason I can't seem to match a parentheses in Flex using Regex

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.