ios - How do I interact with NSObject from JSON? -
I am working in Swift and there is a question.
I have been successful in getting the data back from the API as ARI (Jossan starts with [], this is an array), but I would like to use Returned Nested Objects in a special API (Instead of JSON [] starts with [], so it is not an array structurally. Such data. As you can see, the top level is UserRestoreData, and there are two second level components inside it: Favorite Miyals, and favorite drums. They have any children representing food or drink themselves, and in turn have any number of ingredients.
<"> UserRestoreData": [{"FavoriteMeals" "{{" FoodID ":" 1 "," Title ":" Wal Marcela "," Content ": {" Federal Id ":" 1 "," Name ":" Wail "}}, {" Favorite "Drox ": This function (does not crash when I run this code: [{" PRID ":" 1 "," title ":" mint mozito "}]}]}Is)
var data = NSData (content SOfURL: NSURL) (String: "MYURL")) restore DataDatabase = NSJSONSerialization.JSONObjectWithData (Data, Options: .MutableContainers, Error: Zero) as NSObject
and if I was done to restore println, I get everything back completely though, what do I do from here? Like how do I actually communicate with this NSObject? There is no way to say "okay now bring me a favorite drink of this item"? I have a hard time finding information online (mostly about NSArray, which I understand and have done successfully).
Is this a way to deserialize an object only? Do I cast it anyway? Do I make it in NSARR and iterate through feedback? What do I do with this thing? Sorry, if this is a vague question, then it is just curious how I can repeat it or some parts of it.
Thanks a lot!
instead of as NSObject
you can do as an NSDictionary
and then you will access general content such as NSDictionary
Comments
Post a Comment