خرید بک لینک

Vote count: 0

Hi I am trying to do a simple JSON string to Object conversion. Here is the code:

let u = "somehost.com/api/1/ipa/2"
let url = NSURL(string: u )!

let data = NSData(contentsOfURL: url)!

let parsed: AnyObject? = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments) 

if let json = parsed as? [String: AnyObject]{
    // parse json.
}

but it will not unwrap correctly. Seems to me that this should be much simpler. Could someone please help? Also using Xcode 7.3 and swift 2.2.

I want to avoid using a third party library.

asked 52 secs ago

برچسب: how to parse json,how to parse json in java,how to parse json in javascript,how to parse json in python,how to parse xml,how to parse a string in java,how to parse xml in java,how to parse in excel,how to parse xml in python,how to parse text in excel, نویسنده: استخدام کار تاريخ: شنبه 6 شهريور 1395 ساعت: 11:51

صفحه بندی