Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which method and function is called first when any iOS application start?

Which method and function is called first when any iOS application start ?

like image 359
Milesh Avatar asked Feb 18 '11 10:02

Milesh


3 Answers

I suppose its

int main(int argc, char *argv[])

in main.m file

But for practical purposes I think you usually need to implement some of the UIApplicationDelegate's methods, depending on situation:

application:didFinishLaunchingWithOptions:
applicationDidBecomeActive:
applicationWillEnterForeground:
like image 81
Vladimir Avatar answered Oct 04 '22 16:10

Vladimir


If A View starts up, then it's:

- (void)viewDidLoad {}

If an app starts up it's:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:

or

- (void)applicationWillEnterForeground:(UIApplication *)application {

I think you'l be better of using the ViewDidLoad Method.

I hope i helped!

like image 43
JJgendarme Avatar answered Oct 04 '22 17:10

JJgendarme


actually:

- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions{}

comes before:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{}
like image 24
Pedroinpeace Avatar answered Oct 04 '22 15:10

Pedroinpeace