码迷,mamicode.com
首页 > 其他好文 > 详细

nil和Nil及NULL、NSNull的区别

时间:2015-12-25 01:15:12      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:

nil  是一个对象值;如果我们要把一个对象设置为空的时候就用nil;

A null pointer to an Objective-C object. ( #define nil ((id)0) )

 

Nil :是一个类对象的值,如果我们要把一个Class类型的对象设置为空的时候就用Nil ; 

A null pointer to an Objective-C class.

 

NULL  是一个通用指针;A null pointer to anything else. ( #define NULL ((void *)0) )

 

NSNull  是一个对象,它用在不能使用nil的场合;

A class defines a singleton object used to represent null values in collection objects (which don‘t allow nil values).

 

[NSNull null]: The singleton instance of NSNull.

[NSNull null]是一个对象,他用在不能使用nil的场合。

nil和Nil及NULL、NSNull的区别

标签:

原文地址:http://www.cnblogs.com/iospp/p/5074717.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!