Like any C-based app, the main entry point for an iOS app at launch time is the
main
function. In an iOS app, the main
function is used only minimally. Its main job is to hand control to the UIKit framework. Therefore, any new project you create in Xcode comes with a default main
function like the one shown in Listing 3-1. With few exceptions, you should never change the implementation of this function.main
function of an iOS app#import <UIKit/UIKit.h> |
int main(int argc, char *argv[]) |
{ |
@autoreleasepool { |
return UIApplicationMain(argc, argv, nil, NSStringFromClass([MyAppDelegate class])); |
} |
} |