我的应用程序有崩溃日志。我不明白这个问题:
0 Test Application 0x000e0ccc Test_Application.firstVC.(firstFunc (Test_Application.firstVC) -> () -> ()).(closure #1) (firstVC.swift:110)
1 Test Application 0x000d7f10 partial apply forwarder for Test_Application.firstVC.(firstFunc (Test_Application.firstVC) -> () -> ()).(closure #1) (firstVC.swift:0)
2 Test Application 0x000d7f7c partial apply forwarder for reabstraction thunk helper from @callee_owned (@owned ObjectiveC.NSData!, @owned ObjectiveC.NSURLResponse!, @owned ObjectiveC.NSError!) -> (@unowned ()) to @callee_owned (@in (ObjectiveC.NSData!, ObjectiveC.NSURLResponse!, ObjectiveC.NSError!)) -> (@out ()) (firstVC.swift:0)
3 Test Application 0x000d7ffc partial apply forwarder for reabstraction thunk helper from @callee_owned (@in (ObjectiveC.NSData!, ObjectiveC.NSURLResponse!, ObjectiveC.NSError!)) -> (@out ()) to @callee_owned (@owned ObjectiveC.NSData!, @owned ObjectiveC.NSURLResponse!, @owned ObjectiveC.NSError!) -> (@unowned ()) (firstVC.swift:0)
我有大约 110 行:
let request = NSMutableURLRequest(URL:NSURL(string: "http://localhost.com/")!)
let session = NSURLSession(configuration: NSURLSessionConfiguration.defaultSessionConfiguration())
var bodyData = "test=true"
request.HTTPMethod = "POST"
request.HTTPBody = bodyData.dataUsingEncoding(NSUTF8StringEncoding)
var postData = session.dataTaskWithRequest(request, completionHandler: {(data : NSData!, response : NSURLResponse!, error : NSError!) in
var jsonDict: AnyObject! = NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers, error: nil)
})
这件事特别奇怪,因为当我尝试从 XCode 调试应用程序时它可以工作!但是当我尝试使用 Ad Hoc 部署(diawi.com 或 TestFlight.com)时,我得到了这个错误。