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

The Archive Base Latest Questions

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

Basically, I’ve created a custom view (extending UIView ) that displays at least one

  • 0

Basically, I’ve created a custom view (extending UIView) that displays at least one image (but sometimes two, one on top of each other). The bottom image is a placeholder and since the image being placed on it can be deleted, I would like to be able to just remove the top image so the placeholder is visible again. I’ve created a message for placing an image on top of the placeholder (it removes and releases the last subview and adds the new one) and a message for showing the placeholder. During the course of this message [self addSubview: nil] will be called.

My questions are:

  • Will addSubview: nil cause UB? Is it a bad idea?
  • After adding nil as a subview, will it be added to the subviews array or will it be ignored?
  • 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-24T21:20:15+00:00Added an answer on May 24, 2026 at 9:20 pm

    Is it really a good idea to add two image views to show the placeholder image and original image?

    Just ask yourself why do you want to have two image views separately to show the placeholder and the original image? You can have just one image view and show the placeholder image if the original image is not available meanwhile show the original image if it is available.

    - (void)setMainImage:(UIImage *)mainImage {
    
        if (mainImage) self.mainImageView.image = mainImage;
        else self.mainImageView.image = thePlaceholderImage;
    }
    

    If you want to remove the main image, just call

    [self setMainImage:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I’ve heard that certain conditions will cause .NET to blow past the finally
Basically I'm trying to accomplish the same thing that mailto:bgates@microsoft.com does in Internet Explorer
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I have an iframe loaded that is accessed from the parent whenever it
Basically I am trying to do this: <Trigger Property=Item Value={c:CollectionView.NewItemPlaceHolder}> But the syntax is
Basically I wrote a script that generates a xml file based on user input.
Basically I just need the effect of copying that HTML from browser window and
Basically we've noticed that on some computers setting the JVM option -Xmx (max heap
Basically in my in my aspx page I have a gridview which displays the
Basically I have two models: User and Godfather. The godfather table has three columns:

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.