Check if NSDictionary is empty

后端 未结 8 1362
感情败类
感情败类 2021-02-13 02:22

I want to check if an NSDictionary is empty. I am doing it like this.

  mutDictValues = [[[NSUserDefaults standardUserDefaults] objectForKey:@\"dicV         


        
8条回答
  •  执念已碎
    2021-02-13 03:09

    try this,

    if([myDict count] > 0)
        NSLog(@"Dictionary is not empty");
    else
        NSLog(@"Dictionary is empty");
    

提交回复
热议问题