Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Objective-C – Difference in app startup methods from iOS 4 to iOS 5?

I have developed my app initially for iOS 4 and now that iOS 5 is out I decided to develop for the iOS 5 SDK which now seems to have broken my app.

I have a tab bar application with a navigation controller in each tab.

In iOS 4 everything that was in the -application:didFinishLaunchingWithOptions: method was executed first after startup. After that method was executed, the view controller for the first tab was loaded.

So when I log my startup app process (running the simulator for iOS 4.3) it looks like this:

-[AcandoAppDelegate application:didFinishLaunchingWithOptions:] [Line 35] didFinishLaunchingWithOptions method running
-[AcandoAppDelegate application:didFinishLaunchingWithOptions:] [Line 60] This should be executed first // And it does as it should
-[AcandoAppDelegate applicationDidBecomeActive:] [Line 254] applicationDidBecomeActive method running
-[SeminarsViewController viewDidLoad] [Line 58] 2 - viewDidLoad method running
-[SeminarsViewController viewDidLoad] [Line 60] This should be executed second // Also as it should
-[SeminarsViewController viewWillAppear:] [Line 123] 3 - viewWillAppear method running
-[SeminarsViewController viewDidAppear:] [Line 173] viewDidAppear running

Now when I log my startup app process (running the simulator for iOS 5.0) it looks like this:

-[AcandoAppDelegate application:didFinishLaunchingWithOptions:] [Line 35] didFinishLaunchingWithOptions method running
-[SeminarsViewController viewDidLoad] [Line 58] 2 - viewDidLoad method running
-[SeminarsViewController viewDidLoad] [Line 60] This should be executed second // So this should be executed second but is executed first
-[SeminarsViewController viewWillAppear:] [Line 123] 3 - viewWillAppear method running
-[AcandoAppDelegate application:didFinishLaunchingWithOptions:] [Line 60] This should be executed first // And this is executed second but should be executed first
-[AcandoAppDelegate applicationDidBecomeActive:] [Line 254] applicationDidBecomeActive method running
-[SeminarsViewController viewDidAppear:] [Line 173] viewDidAppear running

Am I missing something obvious here? For me it looks like we have two different startup situations between iOS 4 and iOS 5?

like image 516
Peter Warbo Avatar asked Nov 14 '22 15:11

Peter Warbo


1 Answers

Why does the successful startup of your app depend on a particular sequence of these events? There should be nothing in those sequences above which cause you issue, your code should be oblivious as to the exact underlying startup sequence.

Can you give some code to explain WHY this is causing you an issue?

like image 174
Simon Lee Avatar answered Jan 19 '23 02:01

Simon Lee