Which method is called first when an iPhone application loads?
+3
A:
main()
, like any Objective-C program, but it's not a method, it's a free function. You can look at it to see what happens next.
Lou Franco
2010-07-23 19:31:01
+2
A:
It depends. If you're writing a "valid", "normal", to-be-sold-in-the-AppStore in Objective-C application, then the first usable function will be one of the following UIApplicationDelegate's methods:
application:didFinishLaunchingWithOptions: applicationDidBecomeActive:
or:
applicationDidFinishLaunching: applicationDidBecomeActive: application:handleOpenURL:
It will depend on what methods are implemented in your delegate class and if you want to receive messages (for instance, to respond to PUSH messages, or to "pass arguments" to your application)
Anyway, you should check the UIApplicationDelegate documentation.
rolando
2010-07-23 19:43:21
I'll up-vote just because I am betting the user is looking for this as the answer but, truly, it is in the `main()`
thyrgle
2010-07-29 04:16:28
I agree -- this is probably what he meant to ask.
Jeffrey Berthiaume
2010-08-06 19:30:28