zoukankan      html  css  js  c++  java
  • 母传键老师课堂笔记 -----ViewController的生命周期

    //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];

    }

  • 相关阅读:
    对我人生影响最大的三位老师
    自我介绍
    转-一般产品的使用过程
    谷歌浏览器开发调试工具中Sources面板 js调试等 完全介绍 --转载
    接口测试--总结
    常见正则表达式
    B/S架构的软件,主要的功能测试点有哪些
    SQL语句大全转
    11.2
    11.1
  • 原文地址:https://www.cnblogs.com/fanwenzheIOS/p/4973554.html
Copyright © 2011-2022 走看看