zoukankan      html  css  js  c++  java
  • iOS9新特性之常见关键字

    /*

        nullable:1.怎么使用(语法) 2.什么时候使用(作用)

        nullable作用:可能为空

     

        nullable 语法1

        @property (nonatomic, strong, nullable) NSString *name;

     

        nullable 语法2 * 关键字 变量名

        @property (nonatomic, strong) NSString * _Nullable name;

     

        nullable 语法3

        @property (nonatomic, strong) NSString * __nullable name;

     

     */

     

    /*

     nonnull:1.怎么使用(语法) 2.什么时候使用(作用)

     nonnull作用:不能为空

     

     nonnull 语法1

     @property (nonatomic, strong, nullable) NSString *name;

     

     nonnull 语法2 * 关键字 变量名

     @property (nonatomic, strong) NSString * _Nonnull name;

     

     nonnull 语法3

     @property (nonatomic, strong) NSString * __nonnull name;

     

     */

     

    /*

     

     null_resettable:1.怎么使用(语法) 2.什么时候使用(作用)

     

     null_resettable:必须要处理为空情况,重写get方法

     

     null_resettable作用:get方法不能返回nil,set可以传入为空

     

     null_resettable 语法1

     @property (nonatomic, strong, null_resettable) NSString *name;

     

     */

     

    /*

        _Null_unspecified:不确定是否为空

     */

     

    /*

        关键字注意点

        在NS_ASSUME_NONNULL_BEGIN和NS_ASSUME_NONNULL_END之间默认是nonnull

        

        关键字不能用于基本数据类型(int,float),nil只用于对象

     

     

     */

  • 相关阅读:
    杭电ACM 2052 Picture
    杭电ACM求平均成绩
    杭电ACM水仙花数
    cigarettes
    分数加减法
    推荐几个sql server牛人的博客
    npm 介绍
    centos Flash Player插件的安装
    node.js学习(1)
    查询功能:yum [list|info|search|provides|whatprovides] 参数
  • 原文地址:https://www.cnblogs.com/xufengyuan/p/7209763.html
Copyright © 2011-2022 走看看