I Xcode, I can see the value for item.body()
. and then iterate each of the user. but I can not get the value for users
. Please see the attached image. Thanks!
-
This looks like json. Have a look at github.com/SwiftyJSON/SwiftyJSON in general for a better solution.– tmpzNov 16, 2015 at 13:07
Add a comment
|
1 Answer
form item.body() you are getting a dictionary of [NSObject:AnyObject]. You have to cast that to what you expect the dictionary to look like. I assume here it's [String:AnyObject] so do:
let myStringDict = item.body as? [String:AnyObject]
the you can access they value for the key "users" like:
myStringDict?["users"]