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

母传键老师课堂笔记 -----ViewController的生命周期

时间:2015-11-18 10:25:32      阅读:111      评论:0      收藏:0      [点我收藏+]

标签:

//1.手势,viewcontroller 进入下一页

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

    MCJViewController *mcjVC = [[MCJViewController alloc] init];

    [self presentViewController:mcjVC animated:YES completion:nil];

}

 // 生命周期内容

// 1.

- (instancetype)init

{

    if (self = [super init]) {

        

    }

    return self;

}

 

// 2.

- (void)viewDidLoad {

    [super viewDidLoad];

    self.view.backgroundColor = [UIColor orangeColor];

}

 

// 3.

- (void)viewWillAppear:(BOOL)animated

{

    NSLog(@"%s",__FUNCTION__);

}

 

// 4.

- (void)viewDidAppear:(BOOL)animated

{

    NSLog(@"%s",__FUNCTION__);

}

 

// 5.

- (void)viewWillDisappear:(BOOL)animated

{

    NSLog(@"%s",__FUNCTION__);

}

 

// 6.

- (void)viewDidDisappear:(BOOL)animated

{

   NSLog(@"%s",__FUNCTION__);

}

 

// 7.

- (void)dealloc

{

    NSLog(@"%s",__FUNCTION__);

}

 // 手势,退出本页

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

    [self dismissViewControllerAnimated:YES completion:nil];

}

 

母传键老师课堂笔记 -----ViewController的生命周期

标签:

原文地址:http://www.cnblogs.com/fanwenzheIOS/p/4973554.html

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