开发者

iPhone life cycle

Which met开发者_运维知识库hod is called first when an iPhone application loads?


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.


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.


C++ initializers and +load methods. Here be dragons.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜