I'm developing an ios app, however when I try to get a server response by using this:
if let jsonResult = try NSJSONSerialization.JSONObjectWithData(data!, options: []) as? NSDictionary
I get an error from the server that says:
The data couldn't be read because it's in an incorrect format.
Because my server has the problematic line of code:
{"tripReport":[{"duration":-,"distance":0.0,"reportText1":" " ,"reportText2":"-" ,"totalDistance":0.0,"message1":" ","message2":" ","dateTime2":" ","dateTime1":" "}],"size":0}
I want to get the server response before this line instead, like:{"movementReport":[{"message":"7.88 KM SE of Police Line Constibilary, Faisalabad - Jaranwala Road, FAISALABAD, PUNJAB, PK","reportText":"POSITION","speed":53.0,"dateTime":"2016-Jan-20 11:36 AM","route":null,"longitude":73.270053,"latitude":31.37281}
by using split func or any thing else.. can i brake my response into two strings?