开发者

Check if a NSMutableDictionary is empty?

开发者 https://www.devze.com 2023-02-06 09:20 出处:网络
How can I tell if a开发者_如何学编程n NSMutableDictionary is empty in Objective-C?Very simple, use the -count method inherited from NSDictionary:

How can I tell if a开发者_如何学编程n NSMutableDictionary is empty in Objective-C?


Very simple, use the -count method inherited from NSDictionary:

NSMutableDictionary *dict = ...

BOOL isEmpty = ([dict count] == 0);


I have also faced this problem. Below code is working for me on iOS 7.0.

[dict isKindOfClass:[NSNull class]];
0

精彩评论

暂无评论...
验证码 换一张
取 消