IOS:EmptyProject
새로운 빈 프로젝트(Empty Project)에 대한 분석.
-
main.m
: 최초로 실행되는 파일.
#import <UIKit/UIKit.h>
#import "SampleAppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([SampleAppDelegate class]));
}
}
-
AppDelegate
클래스 선언부 코드는 아래와 같다.
#import <UIKit/UIKit.h>
@interface SampleAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
-
AppDelegate
클래스 구현부 코드는 아래와 같다.
#import "SampleAppDelegate.h"
@implementation SampleAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application { }
- (void)applicationDidEnterBackground:(UIApplication *)application { }
- (void)applicationWillEnterForeground:(UIApplication *)application { }
- (void)applicationDidBecomeActive:(UIApplication *)application { }
- (void)applicationWillTerminate:(UIApplication *)application { }
@end