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]];
精彩评论