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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:04:30+00:00 2026-06-16T20:04:30+00:00

I’ve been reading everything I can find on here about this topic but am

  • 0

I’ve been reading everything I can find on here about this topic but am still not sure the best way to proceed. I have a heavy UIImageView that uses an array of fat UIImages acting as an animated loop. This UIImageView is serving as the background for every screen in the app. (Client’s request, not mine, so don’t hate.) We’ve optimized the png files as small as they can go but it’s still a pretty heavy load.

I’ve read several posts about how UIImage searches the cache for an existing image of that name (Ex. Shared UIImageView for background image throughout app – Singleton Property) but this doesn’t seem to be happening. I’ve also been reading here about singletons and instantiating in the appdelegate but I’m not sure if either of these are the right way to proceed.

What’s the best way to load the UIImageView once over the life of the app and use it in the background of every viewcontroller? Btw, because it takes several seconds to load, I’m going to be adding a “loading” page at app start that uses a single static image and an activity indicator.

Also, I’m not as familiar with testing and performance tools. Which one should I be using to test performance and make sure this is what is causing the hesitations throughout the app?

Apologies in advance for the noob questions – I generally avoid asking questions at all but sometimes, as in this case, I don’t even know where to begin the research.

  • 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-16T20:04:31+00:00Added an answer on June 16, 2026 at 8:04 pm

    I’m rather pleased with myself. I went with the AppDelegate technique and it’s working beautifully. I declared a UIImageView property in the AppDelegate, then add the image code to its getter:

    - (UIImageView *)backgroundImageView {
        if (!_backgroundImageView) {
            NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:150];
            for (int imageNum = 0; imageNum < 150; imageNum++) {
                [tempArray addObject:[UIImage imageNamed:[NSString stringWithFormat:@"image_00%03i.png",imageNum]]];
            }
            _backgroundImageView = [[UIImageView alloc] initWithImage:[UIImage animatedImageWithImages:tempArray duration:4.0]];
        }
        return _backgroundImageView;
    }
    

    This also allowed me to kill the object in applicationDidReceiveMemoryWarning.

    Then I created a helper class that I can pop into all of my UIViewController classes:

    + (void)placeBackgroundImageUnderView:(UIView *)masterView {
        myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate];
        //Correct for shrinkage
        appDelegate.backgroundImageView.frame = masterView.frame;
        [masterView addSubview:appDelegate.backgroundImageView];
        [masterView sendSubviewToBack:appDelegate.backgroundImageView];
    }
    

    This allowed me to add a single line in each viewDidLoad method:

    [HelperClass placeBackgroundImageUnderView:self.view];
    

    The thing is, just using UIImage alone should cache the whole thing and speed up load time. But it seems that every now and then the images would have to reload – memory issues? So this allows me more control over it by instantiating the object once and using that same object, while also being to set that object to nil to free up memory if needed.

    Since adding it, the whole app has been loading much faster. I added an additional load screen with an activity indicator for that initial load (also works beautifully) and everything after that is instant happy.

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

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have a jquery bug and I've been looking for hours now, I can't
This could be a duplicate question, but I have no idea what search terms
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Does anyone know how can I replace this 2 symbol below from the string
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

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.