خرید بک لینک

Vote count: -1

I have this simple code:

let task = session.dataTaskWithRequest(request, completionHandler: {(data, response, error) in

                    print(response)

                    do {
                        let JSON = try NSJSONSerialization.JSONObjectWithData(data!, options:.AllowFragments)

                        // never printed                    
                        print(JSON)

                        guard let JSONDictionary :NSDictionary = (JSON as! NSDictionary) else {
                            print("Not a Dictionary")

                            retu
                        }

                        print("JSONDictionary! (JSONDictionary)")

                    }
                    catch let JSONError as NSError {

                        print("(JSONError)")
                    }

                });

                //
                task.resume()

Well, I can read the response but then I get (lldb) and the app crashes. The line print(JSON) is never printed. I really can't understand what's going on, any tip is appreciated.

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 5 فروردين 1395 ساعت: 21:12

صفحه بندی