1

I'm trying to get a json in my server but the request stops with error EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) when running IPhone 6, 6 plus, 5 and 5s iOS Simulator. Nothing happens when i use Iphone 4s simulator and the app works fine.

let request = NSMutableURLRequest(URL:NSURL(string: "http://172.16.67.1/hidoc/professionals.php?request=getProfessionals")!)
request.HTTPMethod = "POST"
let postString = "access_token="+access_token+"&ind_user="+String(ind_user)
request.HTTPBody = postString.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)
let task = NSURLSession.sharedSession().dataTaskWithRequest(request){ //EXC_BAD_INSTRUCTION is here
    //parsing json
}
task.resume()

Someone knows whats wrong with my code or its a bug from iOS Simulator?

0 Answers0