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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:31:00+00:00 2026-05-29T16:31:00+00:00

I’m a beginning to iOS development. My objective is to reduce load-time perception during

  • 0

I’m a beginning to iOS development. My objective is to reduce load-time perception during application load. I’ve been adding “Start” “ended” flags all over my code to try and figure out where the delay is during my application load. Below is a list of function entry points and exits. My question is:

  • What’s happening after didFinishLaunchingWithOptions? Is there a function I missed?

    1 entry: int main(int, char **)
    2 entry:  -[AppDelegate application:didFinishLaunchingWithOptions:]
    3 entry:   -[AppViewController loadView]
    3 exit :   -[AppViewController loadView]
    3 entry:   -[AppViewController viewDidLoad]
    3 exit :   -[AppViewController viewDidLoad]
    3 entry:   -[AppViewController viewWillAppear:]
    3 exit :   -[AppViewController viewWillAppear:]
    3 entry:   -[AppViewController viewDidAppear:]
    3 exit :   -[AppViewController viewDidAppear:]
    2 exit :  -[AppDelegate application:didFinishLaunchingWithOptions:]
    ? ?????:  //Here i see a VERY LONG PAUSE, possibly loading the view into memory?
              //Anyway to reduce this time here?
    //After this long delay the view actually shows up on the phone.
    

I’m capturing this by littering my code with macros:

  • - (void)viewWillAppear:(BOOL)animated
    {
        MARKSTART;
        [super viewWillAppear:animated];
        MARKEND;
    }
    

For those that might be interested, here are my macros. Adopted from the following webpage: http://www.dizzey.com/development/ios/6-useful-objective-c-cocoa-macros/

  • #define MARK      NSLog(@"----%s", __PRETTY_FUNCTION__);
    #define MARKSTART NSLog(@"/===Entry: %s ===\\", __PRETTY_FUNCTION__);
    #define MARKEND   NSLog(@"\\===Exit : %s ===/", __PRETTY_FUNCTION__);
    

Additional information:

  • I have many buttons in the xib file.
  • Controls are skinned by replacing the background color or image with something
  • PNG Image loading actually happens in viewDidLoad, the disk IO is pretty fast
  • The latest delay feels like when the “view” is actually being loaded into memory, but I can’t be sure.

Any advice on who i can dig deeper into this and find better ways to make my application load more quickly, or perceive that it loads more quickly? My biggest headache is the VERY LONG PAUSE… on iphone 3g (4.2.1 ios) it takes about 4.2 seconds.

Please advise,
Box

Additional Details based on Comments form the the thread. The following code in inside of ViewDidLoad. This happens very quickly taking about 200ms at the most:

wholeImage = [UIImage imageWithContentsOfFile:@"DefaultSkin.png"];
CGImageRef drawImage;

drawImage = CGImageCreateWithImageInRect(wholeImage.CGImage, CGRectMake(0, 0, 320, 480));
imageMainBackground = [[UIImage imageWithCGImage:drawImage] retain];
CGImageRelease(drawImage);

drawImage = CGImageCreateWithImageInRect(wholeImage.CGImage, CGRectMake(320, 0, 320, 480));
imageAnotherBackground = [[UIImage imageWithCGImage:drawImage] retain];
CGImageRelease(drawImage);

I continue this, cutting up the large “whole image” into buttons and controls. Also during ViewDidLoad, I will assign them to views and subviews, like this:

[self.view setBackgroundColor:[UIColor colorWithPatternImage:[GuiSkinManager sharedSingleton].imageMainBackground]];

Debugging output console shows ViewDidLoad with these NSLog outputs:

2012-02-10 12:43:11.150 App [1714:307] Entry: -[AppViewController viewDidLoad]
2012-02-10 12:43:11.467 App [1714:307] Exit : -[AppViewController viewDidLoad]

So the setup and cutting is only 310ms while debugging. But the image itself is not actually processed at this time?

  • 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-29T16:31:01+00:00Added an answer on May 29, 2026 at 4:31 pm

    So it seems that your problem is using setBackgroundColor instead of using a UIImageView. I would guess that’s because setBackgroundColor is meant for when you’re using a small image that is tiled rather than a single background image. A UIImageView will be super optimised for drawing a single image. I assume that’s what’s going on anyway.

    The moral of the story here is to use instruments. It’s a great tool that can really help track down a number of problems. The “Time Profiler” instrument is a great help when working out what’s taking up CPU time.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Specifically, suppose I start with the string string =hello \'i am \' me And
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

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.