开发者

What class is called first in Objective-C program?

开发者 https://www.devze.com 2023-03-21 23:12 出处:网络
In Java one can specify the class what class is called when program starts. It must have public static void main .. you know the drill.

In Java one can specify the class what class is called when program starts. It must have public static void main .. you know the drill.

How about in Objective-C? Of all the classes you may have present in yo开发者_如何学运维ur program which one is called first?


The starting point is not in a class but in the main function, same as regular C:

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

For an iOS app, this is generally generated for you and control is passed into your UIApplicationMain.

For more information, see the section on the main function in the docs here.


The first thing called is main, just like in C. This function usually calls UIApplicationMain, which in turn creates the main application object, based on the contents of the bundle's plist file, and then executes the application's event loop.

0

精彩评论

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

关注公众号