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 agoxazb Let's block ads! بخوانید...
ادامه مطلبVote count: -1 I need to parse the line from the stream that would look like this: command "string1" "string2" string can contain spaces and escaped double-quotes. I need to split it so that I get command, string1 and string2 as array elements. I think split() with regex matching " but not " ( .split("(? ) would do the job, but I hear that that is not a good idea. What's the best way to do that in Java? asked 50 secs agouser1902247 Let's block ads! بخوانید...
ادامه مطلب