if ([dict objectForKey:@"photo"] !=(id)[NSNull null])
{NSLOG(@"dictinary is not empty")}
这对我不起作用。检查空标签
最佳答案
使用计数
。
例如:
if ([dict count] == 0) {
NSLog("empty");
}
如果你想检查一个 key ,那么:
if([dict objectForKey:@"photo"]) {
NSLog(@"There's an object in photo");
}
关于iPhone 检查空字典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11094707/