2

I have crash log from my application. I don't understand this problem:

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)

Around 110 line I have:

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)
        })

Especially strange this thing because when I trying debug application from XCode it's works! But when I try use Ad Hoc deployment (diawi.com or TestFlight.com) I get this error.

Max
  • 1,341
  • 3
  • 20
  • 39
  • Please specify exactly which of the lines in excerpt is 110. As for the fact that it works in Xcode and doesn't work thru AdHoc — it either has to do with fact that in Xcode you're running Debug build, and Release (optimized) build in AdHoc; or the fact that in iOS Simulator you're running x86_64, and ARM on your device. – radex Oct 29 '14 at 19:50
  • Thanks! How I can use release build with simulator? – Max Oct 30 '14 at 09:19
  • I found it! I've changed to release build but problem not repeat on the simulator. With AdHoc problem exist, just with xcode build not :( – Max Oct 30 '14 at 09:25
  • Have you tried running it on a real device, but through Xcode (signed as development, not ad hoc)? – radex Oct 30 '14 at 13:15
  • Yes I did. And this works perfectly! But through adHoc it show error. I do not understand what different install with adHoc (testflightapp.com or diawi.com) and XCode? – Max Oct 30 '14 at 13:46
  • In theory, there should not be a difference between Release build signed as development, and with AdHoc. I suggest asking your question on Apple Developer Forums. Perhaps it is some Swift compiler bug/edge case — there are some Apple folks there who might be able to help. – radex Oct 30 '14 at 14:13

0 Answers0