Him*_*nth 3 arrays dictionary objective-c ios
我有这样的数组
( {
GPSOdometerReading = "11843.6";
"_id" = {
"$oid" = 5656e7175201edbb16a483f4;
};
acc = 0;
)
Run Code Online (Sandbox Code Playgroud)
那么如何知道我的数组是否包含字典?
谢谢.
Roh*_*han 10
你需要在下面的每个对象的数组和检查类上进行累积
BOOL isContainsDict = NO;
for (id value in Array){
if ([value isKindOfClass:[NSDictionary class]]){
isContainsDict = YES;
break; // end since you only want to know if the array contains an instance of dictionary. if it does no need to continue the loop just break and perform the process
}
}
Run Code Online (Sandbox Code Playgroud)