最終更新:2012-12-17 (月) 10:25:34 (4148d)  

UIApplicationMain
Top / UIApplicationMain

This function is called in the main entry point to create the application object and the application delegate and set up the event cycle.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html#//apple_ref/c/func/UIApplicationMain

UIKIT_EXTERN int UIApplicationMain(int argc, char *argv[], NSString *principalClassName, NSString *delegateClassName);

パラメータ

  • argc - 第2引数argvの項目数
  • argv - 引数の配列
  • principalClassName?
    • アプリケーションの主クラス名を指定
    • UIApplicationクラスまたはサブクラスの名前を指定。nilの場合はUIApplication
    • 通常変更する必要はありません
  • delegateClassName?
    • アプリケーションデリゲートのクラス名を指定
    • principalClassName?UIApplicationのサブクラスを指定した場合、サブクラスのデリゲートを指定する必要がある
    • nilの場合は、アプリケーションのメインnibファイルからデリゲートオブジェクトを読み込む

Single View Application

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

関連