zoukankan      html  css  js  c++  java
  • ViewController学习笔记

    The steps that occur during the load cycle are as follows:

    1. Some part of your application asks for the view in the view controller’s view property.

    2. If the view is not currently in memory, the view controller calls its loadView method.

    3. The loadView method does one of the following:

      ● If you override this method, your implementation is responsible for creating all necessary views and assigning a non-nil value to the view property.

      ● If you do not override this method, the default implementation uses the nibName and nibBundle properties of the view controller to try to load the view from the specified nib file. If the specified nib file is not found, it looks for a nib file whose name matches the name of the view controller class and loads that file.

      ● If no nib file is available, the method creates an empty UIView object and assigns it to the view property.

    4. The view controller calls its viewDidLoad method to perform any additional load-time tasks. 

     

    The steps that occur during the unload cycle are as follows:

    1. The application receives a low-memory warning from the system.

    2. Each view controller calls its didReceiveMemoryWarning method:

      • ●  If you override this method, you should use it to release any custom data that your view controller object no longer needs. You should not use it to release your view controller’s view. You must call super at some point in your implementation to perform the default behavior.

      • ●  The default implementation releases the view only if it determines that it is safe to do so.

    3. If the view controller releases its view, it calls its viewDidUnload method. You can override this method

      to perform any additional cleanup required for your views and view hierarchy.

  • 相关阅读:
    未启用当前数据库的 SQL Server Service Broker,因此查询通知不受支持。如果希望使用通知,请为此数据库启用 Service Broker
    .net remoting 尝试
    上传图片时获取所传图片大小
    图象处理算法(二)
    对CollapablePanel控件的改进
    一个简单的网页计数器
    ValidateBox控件使用Ajax改进
    图象处理算法(四)
    常用技巧(一)
    在Asp.Net里使用自定义映射进行重定向
  • 原文地址:https://www.cnblogs.com/linyawen/p/2537298.html
Copyright © 2011-2022 走看看