开发者

iPhone life cycle

开发者 https://www.devze.com 2023-01-08 09:52 出处:网络
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 happen

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

精彩评论

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

关注公众号