我想检查一个NSDictionary
是否为空。我正在这样做。
mutDictValues = [[[NSUserDefaults standardUserDefaults] objectForKey:@"dicValues"]mutableCopy];
NSLog(@"dictValues are %@",mutDictValues);
if(mutDictValues == NULL){
arrCities = [[NSMutableArray alloc]init];
NSLog(@"no cities seleceted");
}else{
arrCities = [[NSMutableArray alloc]init];
arrCities = [mutDictValues objectForKey:@"cities"];
[self placeCities];
}
但它总是在这条线上崩溃,arrCities = [mutDictValues objectForKey:@"cities"];
并出现以下错误:
-[__NSCFConstantString objectForKey:]:
有人可以帮我弄这个吗 ?