I have an NSString like this:
[{"comment":"I am just weighing the idea."}]
How do I make it into a JSON object and get the value of the comment key?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use iOS’s
NSJSONSerializationobject to get an object graph from JSON string/data. That API expects an NSData, so first you’ll need to put the string into one.After processing, that root object should be an array or dictionary. In your case, it’s clearly an array containing a dictionary.