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!
# EditedHere 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.