zoukankan      html  css  js  c++  java
  • Chapter 8 UITableView and UITableViewController

    Chapter 8 UITableView and UITableViewController 

     

    1. The designated initializer of UITableViewController is initWithStyle:, which takes a constant that determines the style of the table view. There are two options: UITableViewStylePlain and UITableViewStyleGrouped. These looked quite different on iOS6, but the differences are quite minor as of iOS7.

     

    2. A static variable is not destroyed when the method is done executing. Like a global variable, it is not kept on the stack. Static variable can be used singleton pattern.

     

    +(instancetype)sharedStore

    {

        static BNRItemStore *sharedStore = nil;

        if(!sharedStore)

        {

            sharedStore = [[self alloc] initPrivate];

        }

        return sharedStore;

    }

     

    -(instancetype)initPrivate

    {

        self = [super init];

        return self;

    }

     

    3. Using the @class directive can speed up compile times considerably because fewer files have to be recompiled when one file changes.

     

    4. To reuse UITableViewCell, the UITableViewCell should be registered to the table view firstly.

     

     

     

     

  • 相关阅读:
    闭包
    原型继承
    js时间戳转成日期格式
    常用正则表达式
    vue中如何实现pdf文件预览?
    Vue动画效果
    手把手教你封装 Vue 组件,并使用 npm 发布
    LCD驱动(FrameBuffer)实例开发讲解
    每个程序员都该阅读的书
    LCD platform_device(s5pv210)
  • 原文地址:https://www.cnblogs.com/1oo1/p/3978401.html
Copyright © 2011-2022 走看看