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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:52:33+00:00 2026-05-24T10:52:33+00:00

I have an application that is working as it was supposed to. However, I

  • 0

I have an application that is working as it was supposed to.

However, I put one breakpoint at the first line of my rootViewController’s viewDidLoad method and another breakpoint in the first line of my delegate’s didFinishLaunchingWithOptions,

Surprisingly for me, the application entered in the viewDidLoad method, then went to the didFinishLaunchingWithOptions, and then executed one more time the viewDidLoad method.

What is going on? I think that that behavior is totally wrong.

Thank you in advance!

#

Edited

Here goes my iPad’s delegate didFinishLaunchingWithOptions method:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{   
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    UtilXML *utilXML = [[UtilXML alloc] init];
    [utilXML startXMLCommunication];
    int quantidadeDeComicsBaixadas = [utilXML quantidadaDeComicsBaixadas];

    main_iPad *mainiPad = [[main_iPad alloc] init];
    mainiPad.quantidadeDeComicsBaixadas = quantidadeDeComicsBaixadas;
    mainiPad.navigationItem.title = @"TitleFirstScreen";

    UIBarButtonItem *botaoSobre = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:mainiPad action:@selector(goToAboutView)];
    mainiPad.navigationItem.rightBarButtonItem = botaoSobre;

    navController = [[UINavigationController alloc] initWithRootViewController:mainiPad];
    navController.navigationBar.tintColor = [UIColor orangeColor];
    navController.navigationBar.translucent = YES;


    [self.window addSubview:navController.view];
    [self.window makeKeyAndVisible];
    return YES;
}

And here is my iPhone’s delegate didFinishLaunchingWithOptions method:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[UIApplication sharedApplication] setStatusBarHidden:NO];

    UtilXML *utilXML = [[UtilXML alloc] init];
    [utilXML startXMLCommunication];
    int quantidadeDeComicsBaixadas = [utilXML quantidadaDeComicsBaixadas];

    main_iPhone *mainiPhone = [[main_iPhone alloc] init];
    mainiPhone.quantidadeDeComicsBaixadas = quantidadeDeComicsBaixadas;
    mainiPhone.navigationItem.title = @"TitleFirstScreen";

    UIBarButtonItem *botaoSobre = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:mainiPhone action:@selector(goToAboutView)];
    mainiPhone.navigationItem.rightBarButtonItem = botaoSobre;

    navController = [[UINavigationController alloc] initWithRootViewController:mainiPhone];
    navController.navigationBar.tintColor = [UIColor orangeColor];
    navController.navigationBar.translucent = YES;

    [self.window addSubview:navController.view];
    [self.window makeKeyAndVisible];
    return YES;
}

This strange behavior occurs in both devices.

  • 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-24T10:52:34+00:00Added an answer on May 24, 2026 at 10:52 am

    The documentation for application:didFinishLaunchingWithOptions:

    You should use this method to initialize your application and prepare
    it for running. It is called after your application has been launched
    and its main nib file has been loaded. At the time this method is
    called, your application is in the inactive state. At some point after
    this method returns, a subsequent delegate method is called to move
    your application to the active (foreground) state or the background
    state.

    So the view is lazily loaded for view controllers once the the view property or method is called. When this happens viewDidLoad is called so if your window rootViewController property is set to your root ViewController in the nib then this is expected behavior.

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

Sidebar

Related Questions

I have an application that is working as a proxy using QTcpSocket to intercept
I have a web application that I'm working on for work and its not
I have a Core Data based mac application that is working perfectly well until
I have a small VB.NET application that I'm working on using the full version
I have a usercontrol in an asp web forms application that I am working
I am working on splitting out an existing, working application that I currently have
I have been working on a BlackBerry application that consumes web services from ColdFusion
I have am working on a web application that makes use of helper classes.
I have recently been working on a C# application that calls a webservice over
I'm working on an application that will have attachments, and I would like to

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.