iOS
Objective-C 中不同类型的“空值”
以 NSDictionary 的 objectForKey 方法为例,如果字典中不存在指定的 key,返回值为 nil,如果指定的 key 存在,但是值为空,返回值则是 [NSNull null]。 There are three possible interpretations of "null" NSString: someStringPtr == nil (id)someStringPtr == [NSNull null] someStringPtr.length == 0 If you may have the possibility of all 3, the 3rd check subsumes the first,