开发者

Check if a NSMutableDictionary is empty?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜