I have a JSON object as such:
The Result {
shops = ({
date = "2015-07-22T14:14:48.867618";
"num_items" = 0;
score = "-1";
"total_spend" = 0;
},
{
date = "2015-07-22T14:17:03.713194";
"num_items" = 1;
score = 5;
"total_spend" = "1.85";
});
}
And My Code:
let dict = result as! NSDictionary
var mutDict: NSMutableDictionary = dict.mutableCopy() as! NSMutableDictionary
for (key, value) in mutDict {
for i in 0..<backendArray.count {
if value[i].objectForKey("num_items") === 0
{
//delete that shop only
}
}
}
I want to delete the whole first shop and all of it's contents, but not the second shop or the shops.
I don't want to turn it into an Array, because I can't figure out how to turn it back. Data needs to be stored still as a Dictionary. Thanks