码迷,mamicode.com
首页 > 其他好文 > 详细

控制器的生命周期

时间:2015-03-31 22:26:45      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:控制器的周期

#import "MJOneViewController.h"


@interface MJOneViewController ()

@property (nonatomic, strong) NSArray *apps;

@property (nonatomic, strong) NSArray *persons;

@end


@implementation MJOneViewController


/***

 

 

 */


/**

 *  view加载完毕

 */

- (void)viewDidLoad

{

    [super viewDidLoad];

    

    NSLog(@"MJOneViewController-viewDidLoad");

}


/**

 *  view即将显示到window

 *

 */

- (void)viewWillAppear:(BOOL)animated

{

    [super viewWillAppear:animated];

    

    NSLog(@"MJOneViewController-viewWillAppear");

}


/**

 *  view显示完毕(已经显示到窗口)

 */

- (void)viewDidAppear:(BOOL)animated

{

    [super viewDidAppear:animated];

    

    NSLog(@"MJOneViewController-viewDidAppear");

}


/**

 *  view即将从window上移除(即将看不见)

 *

 */

- (void)viewWillDisappear:(BOOL)animated

{

    [super viewWillDisappear:animated];

    

    NSLog(@"MJOneViewController-viewWillDisappear");

}


/**

 *  viewwindow上完全移除(完全看不见)

 *

 */

- (void)viewDidDisappear:(BOOL)animated

{

    [super viewDidDisappear:animated];

    

    NSLog(@"MJOneViewController-viewDidDisappear");

}


/**

 *  view即将销毁的时候调用

 */

- (void)viewWillUnload

{

    [super viewWillUnload];

}


/**

 *  view销毁完毕的时候调用

 */

- (void)viewDidUnload

{

    [super viewDidUnload];

    

    // 由于控制器的view已经不在了,需要显示在view上面的一些数据也不需要

    self.apps = nil;

    self.persons = nil;

//    

//    [self.apps release];

//    [self.persons release];

}


/**

 *  当接收到内存警告的时候

 */

- (void)didReceiveMemoryWarning

{

    [super didReceiveMemoryWarning];


}

技术分享

#import "MJTwoViewController.h"


@interface MJTwoViewController ()


@end


@implementation MJTwoViewController

/**

 *  view加载完毕

 */

- (void)viewDidLoad

{

    [super viewDidLoad];

    

    NSLog(@"MJTwoViewController-viewDidLoad");

}


/**

 *  view即将显示到window

 *

 */

- (void)viewWillAppear:(BOOL)animated

{

    [super viewWillAppear:animated];

    

    NSLog(@"MJTwoViewController-viewWillAppear");

}


/**

 *  view显示完毕(已经显示到窗口)

 */

- (void)viewDidAppear:(BOOL)animated

{

    [super viewDidAppear:animated];

    

    NSLog(@"MJTwoViewController-viewDidAppear");

}


/**

 *  view即将从window上移除(即将看不见)

 *

 */

- (void)viewWillDisappear:(BOOL)animated

{

    [super viewWillDisappear:animated];

    

    NSLog(@"MJTwoViewController-viewWillDisappear");

}


/**

 *  viewwindow上完全移除(完全看不见)

 *

 */

- (void)viewDidDisappear:(BOOL)animated

{

    [super viewDidDisappear:animated];

    

    NSLog(@"MJTwoViewController-viewDidDisappear");

}

技术分享


控制器的生命周期

标签:控制器的周期

原文地址:http://blog.csdn.net/tubiebutu/article/details/44784705

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!