main.mで指定されているように、UIApplicationのDelegateを担当するクラスですね。
stroyboardを利用している場合、次2点に注目箇所でしょうか。
- ViewControllerをプロパティに持っていない。
#import <UIKit/UIKit.h>
@interface HelloWorldAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
- didFinishLaunchingWithOptionsのコーディング
いままでは、didFinishLaunchingWithOptionsにwindowをallocして、ViewCotrollerをallocして、プロパティに突っ込んで、windowのrootViewControllerプロパティに突っ込んでなどなどアプリのWindows生成とView生成を書いていましたが、今回はこれらの仕事をstorybordファイルが担当するようです。
なので、didFinishLaunchingWithOptionsには特に何の処理を書かれていません。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
アプリの起動時の内部処理もかわっているようで、APIに次のように書いてありました。
During setup, the application object performs the following tasks:
1.Loads the main storyboard file.
main storybordファイルを読み込みます。
2.Gets the window object from the app delegate (or creates a new instance of UIWindow and associates it with the app delegate).
delegateからwindow objectを作るぜ。
3.Instantiates the storyboard’s initial view controller and assigns it as the window object’s root view controller.
ストーリーボードの最初のビューコントローラをインスタンス化し、windowオブジェクトのroorViewControllerとして割り当てる。
だそうです。