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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:47:10+00:00 2026-05-25T06:47:10+00:00

I have a UIViewController that first sets up the view and initializes some HTTPRequests

  • 0

I have a UIViewController that first sets up the view and initializes some HTTPRequests in the -(void)viewDidLoad and in the callbacks for the HTTPrequests, that is where a bunch of UIImageViews and UILabels and such are dynamically placed into the UIView (they are created and released immediately after the addSubview).

What I want is for my ViewController to “refresh” with updated images/text when the user presses the home button and opens the app again. I started with

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil];

And the test method works fine, but I’m stuck on the best way to show the new data.

I thought of adding tags to each and every object that could change, and then altering it like that but that seems like a management nightmare. I read about [self.view setNeedsDisplay] but I don’t think this can work in my situation

  • 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-25T06:47:11+00:00Added an answer on May 25, 2026 at 6:47 am

    setNeedsDisplay will refresh a UIView that is already present. If you have a visible UIImageView, change the image it contains, then call [theImageView setNeedsDisplay] it will do what you want.

    Do you really need to programmatically create a bunch of new UIImageViews all the time, or would it work to have some there permanently, while changing the images they display?

    If you really do need to remove the UIImageViews and place new ones in your parent view, also add them to a container like an NSMutableArray or an NSSet. Then you can iterate through your container of image views, detach them from their parent views, remove them from the container then release them.

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

Sidebar

Related Questions

(first UIViewController)I have several UITextfields that will have some number value within them. I
I have a UIViewController that manages the display of some data. When the user
I have 1 UIViewController. in that i wrote, - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { NSLog(@A); }
I have a UIPopOverController that shows a UIViewController with a UITableview in its view.
I'm trying to do some simple animation. I have a UIViewController that has two
First a little background info: I have UIViewController that contains a UITableView. In the
I have a UIViewController that materializes its view in loadView (i.e. no nib). Per
I have created one navigation based application. In that first view show me the
I have a UIViewController subclass that accesses self.navigationController in viewDidLoad:. Depending on where it
I have a View that has a UIWebView, and an OptionsPane (Custom UIViewController with

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.