get object from json string in iOS - Xcode -


i have "json" string this.

**

{"success":true,"domains":[{"url":"","name":"test alpha","id":"100"}]}

**

i want check success true and, if true, url.

how can in iphone application - xcode?

nsdata* data = [mystr datausingencoding:nsutf8stringencoding];  nsdictionary* dictionary = [nsjsonserialization jsonobjectwithdata:data options:nsjsonreadingmutablecontainers error:&error]; if(yes == dictionary[@"success"]) {     nsstring *urlstring = dictionary[@"domains"][0][@"url"]; } 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -