zoukankan      html  css  js  c++  java
  • UIViewController生命周期

    #import "DetailViewController.h"

    @interface DetailViewController ()

    @end

    @implementation DetailViewController

    #pragma mark - 视图控制器对象的初始化方法

    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil

    {

        self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];

        if (self) {

            // Custom initialization

            NSLog(@"%s", __FUNCTION__);

        }

        return self;

    }

    #pragma mark - 加载视图的方法

    - (void)loadView {

        [super loadView];

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 视图已经加载完成

    - (void)viewDidLoad

    {

        [super viewDidLoad];

    // Do any additional setup after loading the view.

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 实现---dismissButtonAction:方法

    - (void)dismissButtonAction:(UIButton *) sender {

        // 调用模态的关闭的方法

        [self dismissViewControllerAnimated:YES completion:nil];

    }

    #pragma mark - 已经接收到内存警告

    - (void)didReceiveMemoryWarning

    {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 视图将要出现

    - (void)viewWillAppear:(BOOL)animated {

        [super viewWillAppear:animated];

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 视图已经出现

    - (void)viewDidAppear:(BOOL)animated {

        [super viewDidAppear:animated];

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 视图将要消失

    - (void)viewWillDisappear:(BOOL)animated {

        [super viewWillDisappear:animated];

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 视图已经消失

    - (void)viewDidDisappear:(BOOL)animated {

        [super viewDidDisappear:animated];

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - 已经被弃用的方法

    - (void)viewDidUnload {

        [super viewDidUnload];

        NSLog(@"%s", __FUNCTION__);

    }

    #pragma mark - dealloc方法

    - (void)dealloc {

        NSLog(@"%s", __FUNCTION__);

        [_dismissButton release], _dismissButton = nil;

        [super dealloc];

    }

    @end

  • 相关阅读:
    判断touchmove上下的方向
    this的指向
    JS 判断浏览器是否安装Flash 兼容IE、firefox
    Array类型
    addEventListener()与removeEventListener()
    tap 点透问题
    ts 接口
    ts 类型断言
    ts学习
    vue时间戳转换(10位数)/(13位)
  • 原文地址:https://www.cnblogs.com/lhp-1992/p/4641667.html
Copyright © 2011-2022 走看看