IOS_시작 과정프로젝트 파일전통 xib로드 view빈 항목

H: / 0720 / 01 - Application 과 AppDelegatemain.m
//
//  main.m
//  01-Application AppDelegate
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "MJAppDelegate.h"

int main(int argc, char *argv[])
{
    @autoreleasepool {
        NSString *str = NSStringFromClass([MJAppDelegate class]);
        NSLog(@"%@", str);
        
        //NSString *str2 = NSStringFromClass([UIApplication class]);
        
        /*
		  2   : C    
          3   :         (   UIApplication    ,
					  nil,    UIApplication)
					1 UIApplication  1     ,   ~
					    UIApplication   
          4   :UIApplication     ,    storyboard  ,   app  
         
         */
        return UIApplicationMain(argc, argv, nil, str);
    }
}

H: / 0720 / 01 - Application 과 AppDelegateMJAppDelegate.h
//
//  MJAppDelegate.h
//  01-Application AppDelegate
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MJAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

H: / 0720 / 01 - Application 과 AppDelegateMJAppDelegate.m
//  MJAppDelegate.m
//  01-Application AppDelegate
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
#import "MJAppDelegate.h"
/*
	       ,             
*/
@implementation MJAppDelegate
// ----------------    ,    2   -----------------------------
#pragma mark             (      ,              )
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    NSLog(@"FinishLaunching");
    // Override point for customization after application launch.
    return YES;
}
#pragma mark  app         (   )
- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    NSLog(@"BecomeActive");
}
// ----------------    home  ,     ,        -----------------------------
#pragma mark  app         (   )
- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    NSLog(@"ResignActive");
}
#pragma mark  app         
- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    NSLog(@"EnterBackground");
}
// -----------------        ,    ,     2   (BecomeActive)-----------------------------

#pragma mark  app         
- (void)applicationWillEnterForeground:(UIApplication *)application
{
    NSLog(@"EnterForeground");
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
#pragma mark  app         (    :app     ,    )
- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end

H: / 0720 / 01 - Application 과 AppDelegateMJViewController.h
//
//  MJViewController.h
//  01-Application AppDelegate
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MJViewController : UIViewController
- (IBAction)click;

@end

H: / 0720 / 01 - Application 과 AppDelegateMJViewController.m
//  MJViewController.m
//  01-Application AppDelegate
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
#import "MJViewController.h"
@interface MJViewController ()
@end
@implementation MJViewController

//       ,              
- (IBAction)click {
	//         ,        UIApplication
    UIApplication *app =  [UIApplication sharedApplication];
    //           ,    0,    
    //app.applicationIconBadgeNumber = 5;
    //    ,       ,        ,  
    //app.networkActivityIndicatorVisible = YES;
    //    \   \   \  safari   
    NSURL *url = [NSURL URLWithString:@"tel://10086"];
    //    ,NSURL *url = [NSURL URLWithString:@"http://www.baidu.com"];
    [app openURL:url];
}
@end

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일main.m
//
//  main.m
//  02-        
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "MJAppDelegate.h"

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

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일MJAppDelegate.h
//
//  MJAppDelegate.h
//  02-        
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

@interface MJAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일MJAppDelegate.m
//  MJAppDelegate.m
//  02-        
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
#import "MJAppDelegate.h"
@implementation MJAppDelegate
#pragma mark       
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //      ,     ,      ,      ,     
    application.statusBarHidden = NO;
    /*
    Default.png   320x480 Iphone3
    [email protected]  640x960 Iphone4
    [email protected]  640x1136 Iphone5
     */
    // Override point for customization after application launch.
    return YES;
}
							
- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일MJViewController.h
//
//  MJViewController.h
//  02-        
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

@interface MJViewController : UIViewController
@property (weak, nonatomic) IBOutlet UIImageView *imageView;
- (IBAction)click;

@end

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일MJViewController.m
//  MJViewController.m
//  02-        
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
/*
	      :
	1,info.plist     ,        
		    app       ,     ,app  ,     
		      bundle display name  ,  clean+  app,  ,  
	2,infoPlist.strings           i18n
	3,Prefix.pch  ,  !!! .h   ,                ,
		              #import  ,
		                
		  :   Log  
		#define log(...) NSLog(__VA_ARGS__)
		#define echo(...) NSLog(__VA_ARGS__)
		#define print(...) NSLog(__VA_ARGS__)
		#define var_dump(...) NSLog(__VA_ARGS__)
		          ,        
		#define log(...)  //NSLog(__VA_ARGS__)
		                DEBUG,        
		  ,         :
		#ifdef DEBUG
			#define log(...) NSLog(__VA_ARGS__)
		#else
			#define log(...) 
		#endif
	4,       ,       
		Default.png   320x480 Iphone3
		[email protected]  640x960 Iphone4
		[email protected]  640x1136 Iphone5
	5,icon.png       
-------------------------------------------------
        :
1,  app  ,  main  ,  UIApplicationMain  
2,  UIApplication  ,    UIApplicationDelegate
3,      ,      
4,      ,     didFinishLanchWithOptions  
5,     delegate     :
	a,      
		self.window=[[UIWindow alloc] initWithFrame...
	b,       
		self.viewController=[[MJViewController alloc]initWithNibName...
	c,     root            
		self.window.rootViewController=self.viewController
	d,  ,        ,   
		[self.window makeKeyAndVisible]
	
*/
#import "MJViewController.h"
@interface MJViewController ()
@end
@implementation MJViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.imageView.image = [UIImage imageNamed:@"0.png"];
    int count = 10;
    /*
     #define MJLog(...)  NSLog(__VA_ARGS__)
     */
    MJLog(@"count=%d", count);
    //NSLog(@"count=%d", count);
    MJLog(@"%d-----%d", count, 100);
	// Do any additional setup after loading the view, typically from a nib.
}
- (IBAction)click {
    NSLog(@"%@", [UIApplication sharedApplication].keyWindow);
    NSLog(@"%@", self.view.superview);
}
@end

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일Person.h
//
//  Person.h
//  02-        
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Person : NSObject

@end

H: / 0720 / 02 - 프로젝트 에서 흔히 볼 수 있 는 파일Person.m
//
//  Person.m
//  02-        
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import "Person.h"

@implementation Person

@end

H: / 0720 / 03 - 전통 xib 의 사용main.m
//
//  main.m
//  03-  xib   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "MJAppDelegate.h"

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

H: / 0720 / 03 - 전통 xib 의 사용MJAppDelegate.h
//
//  MJAppDelegate.h
//  03-  xib   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@class MJViewController;

@interface MJAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) MJViewController *viewController;

@end

H: / 0720 / 03 - 전통 xib 의 사용MJAppDelegate.m
//
//  MJAppDelegate.m
//  03-  xib   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import "MJAppDelegate.h"

#import "MJViewController.h"



@implementation MJAppDelegate
//UIWindow *mywindow;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //     UIWindow
    CGRect rect = [[UIScreen mainScreen] bounds];
    self.window = [[UIWindow alloc] initWithFrame:rect];
    
    self.window.backgroundColor = [UIColor redColor];
    
    //          
    //self.viewController = [[MJViewController alloc] initWithNibName:@"MJViewController" bundle:nil];
    
    //           
    //self.window.rootViewController = self.viewController;
    //    UIWindow     ,   rootViewControoler view   UIWindow   
    //            
    //[self.window addSubview:self.viewController.view];
    
    //             
    [self.window makeKeyAndVisible];
    //              ,   :           
    //                  
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd];
    //[btn addTarget:self action:<#(SEL)#> forControlEvents:<#(UIControlEvents)#>];
    btn.center = CGPointMake(100, 100);
    [self.window addSubview:btn];
    
    /*
    mywindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 100, 100, 100)];
    mywindow.backgroundColor = [UIColor yellowColor];
    [mywindow makeKeyAndVisible];*/
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

H: / 0720 / 03 - 전통 xib 의 사용MJViewController.h
//
//  MJViewController.h
//  03-  xib   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MJViewController : UIViewController

@end

H: / 0720 / 03 - 전통 xib 의 사용MJViewController.m
//
//  MJViewController.m
//  03-  xib   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import "MJViewController.h"

@interface MJViewController ()

@end

@implementation MJViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

H: / 0720 / 04 - 컨트롤 러 view 의 로드MJAppDelegate.h
//  MJAppDelegate.h
//  04-   view   
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
#import <UIKit/UIKit.h>
@class MJViewController;
@interface MJAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) MJViewController *viewController;
@end

H: / 0720 / 04 - 컨트롤 러 view 의 로드MJAppDelegate.m
//  MJAppDelegate.m
//  04-   view   
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
#import "MJAppDelegate.h"
#import "MJViewController.h"
@implementation MJAppDelegate
/*
        :
1,  app  ,  main  ,  UIApplicationMain  
2,  UIApplication  ,    UIApplicationDelegate
3,      ,      
4,      ,     didFinishLanchWithOptions  
5,     delegate     :
	a,      
		self.window=[[UIWindow alloc] initWithFrame...
	b,       
		self.viewController=[[MJViewController alloc]initWithNibName...
	c,     root            
		self.window.rootViewController=self.viewController
	d,  ,        ,   
		[self.window makeKeyAndVisible]

*/
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
	//         :      
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    //      (    view     :      )
    self.viewController = [[MJViewController alloc] initWithNibName:@"MJViewController" bundle:nil];
    //self.viewController.view.backgroundColor = [UIColor blueColor];
    //       (         view),     root            
    self.window.rootViewController = self.viewController;
    /*
     1.   MJViewController view      
     2.  view ,        loadView    view
     3.loadView  view     (UIViewController     )
        1>   nibName  ,       xib     view
        2>   nibName   
           1)     MJView.xib     view
           2)   ,  MJViewController.xib     view
           3)            xib  ,            view
     */
    [self.window makeKeyAndVisible];
    return YES;
}
@end

H: / 0720 / 04 - 컨트롤 러 view 의 로드MJViewController.h
//  MJViewController.h
//  04-   view   
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
/*
   :
 1.loadView     
 2.veiwDidLoad       ,  view      ,    ,     
 3.    view 2     :
 1> xib
 2>   (  loadView  )
 */
#import <UIKit/UIKit.h>
@interface MJViewController : UIViewController
@end

H: / 0720 / 04 - 컨트롤 러 view 의 로드MJViewController.m
//  MJViewController.m
//  04-   view   
/*
1.   MJViewController view      
2.  view ,        loadView    view
3.loadView  view     (UIViewController     )
1>   nibName  ,       xib     view
2>   nibName   
   1)     MJView.xib     view
   2)   ,  MJViewController.xib     view
   3)            xib  ,            view
3>      loadview   ,       ,        view   
	- (void)loadView
	{
	}
	
*/
#import "MJViewController.h"
@interface MJViewController ()
@end
@implementation MJViewController
/*
    LoadView       view ,
           ,       view
- (void)loadView
{
    NSLog(@"loadView");
}*/
#pragma mark    view
/*
- (void)loadView
{
    //              view ,       super loadView 
		     loadView       ,     view  ,            view 
		
		  loadView  view     (MJView Controller     )
		1>   nibName  ,       xib     view
		2>   nibName   
		   1)     MJView.xib     view(           xib)
		   2)   ,  MJViewController.xib     view(         xib)
		   3)            xib  ,   loadview           view
		3>      loadview   ,       ,        view   
			- (void)loadView
			{
			}
		4>         view ,  loadView,        super loadView
		5>  loadView    ,  self.view.frame      
			  , 1    view,    view, ,       loadView  ,
			         

    //    ,  self.view.frame  1       view,     loadView  ....	
    //self.view = [[UIScrollView alloc] initWithFrame:self.view.frame];

    //     :         view frame
    CGRect frame = [UIScreen mainScreen].applicationFrame;
    self.view = [[UIScrollView alloc] initWithFrame:frame];
    self.view.backgroundColor = [UIColor yellowColor];
}*/
#pragma mark view loaded   view   ,      ,    ,   
- (void)viewDidLoad
{
    [super viewDidLoad];
    //    LoadView     ,     ,         ,      
}
@end

H: / 0720 / 05 - 빈 프로젝트FirstViewController.h
//
//  FirstViewController.h
//  05-   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController

@end

H: / 0720 / 05 - 빈 프로젝트FirstViewController.m
//  FirstViewController.m
//  05-   
/*
	Xcode,  ,  empty project
	1,   ,     delegate.h/.m
	          ,    
	     delegate   UIWindow
	2,    OC class,   UIViewController
	       with xib     
	   :3   ,  ,storyboard,xib
	3,  FirstViewController.h/.m/.xib
	4, MJAppDelegate.m     FirstViewController.h
	               FirstViewController
	  
*/

#import "FirstViewController.h"
@interface FirstViewController ()
@end
@implementation FirstViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
@end

H: / 0720 / 05 - 빈 프로젝트main.m
//
//  main.m
//  05-   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "MJAppDelegate.h"

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

H: / 0720 / 05 - 빈 프로젝트MJAppDelegate.h
//
//  MJAppDelegate.h
//  05-   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MJAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

H: / 0720 / 05 - 빈 프로젝트MJAppDelegate.m
//
//  MJAppDelegate.m
//  05-   
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
/*
	Xcode,  ,  empty project
	1,   ,     delegate.h/.m
	          ,    
	     delegate   UIWindow
	2,    OC class,   UIViewController
	       with xib     
	   :3   ,  ,storyboard,xib
	3,  FirstViewController.h/.m/.xib
	4, MJAppDelegate.m     FirstViewController.h
	               FirstViewController
	  
*/

#import "MJAppDelegate.h"
#import "FirstViewController.h"

@implementation MJAppDelegate

- (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.rootViewController = [[FirstViewController alloc] init];
    //     
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

H: / 0720 / 06 - 빈 프로젝트FirstViewController.h
//
//  FirstViewController.h
//  06-   2
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface FirstViewController : UIViewController

@end

H: / 0720 / 06 - 빈 프로젝트FirstViewController.m
//
//  FirstViewController.m
//  06-   2
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import "FirstViewController.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

H: / 0720 / 06 - 빈 프로젝트main.m
//
//  main.m
//  06-   2
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "MJAppDelegate.h"

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

H: / 0720 / 06 - 빈 프로젝트MJAppDelegate.h
//
//  MJAppDelegate.h
//  06-   2
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface MJAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) IBOutlet UIWindow *window;

@end

H: / 0720 / 06 - 빈 프로젝트MJAppDelegate.m
//
//  MJAppDelegate.m
//  06-   2
//
//  Created by apple on 13-7-20.
//  Copyright (c) 2013  itcast. All rights reserved.
//

#import "MJAppDelegate.h"
#import "FirstViewController.h"

@implementation MJAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    //NSLog(@"%@", self.window);
    
    //[self.window makeKeyAndVisible];
    return YES;
}

/*
- (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.rootViewController = [[FirstViewController alloc] init];
    [self.window makeKeyAndVisible];
    return YES;
}*/

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

좋은 웹페이지 즐겨찾기