I named the result resultdict
and the NSDictionary
looks like this:
{
data = (
);
summary = {
"total_count" = 514;
};
}
How do I get the "514" from that? I am using swift.
I named the result resultdict
and the NSDictionary
looks like this:
{
data = (
);
summary = {
"total_count" = 514;
};
}
How do I get the "514" from that? I am using swift.
You can just do it like :
var totalCount = yourDict.objectForKey("summary").objectForKey("total_count")
convert it to string
var totalCount = yourDict.objectForKey("summary").objectForKey("total_count") as! String
If you use :
println(totalCount)
will result in
Optional(514)
Use that variable as you want
Try this one
var totalCount = yourDict.valueForKeyPath("summary.total_count")