-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exception in shouldHandleRequest #17
Comments
What were you doing before this error -- invoking a server method? If so, what does the server method look like and what does it return? |
i am getting blank in msg.. |
it was working fine, but it stopped working suddenly... after i updated the pods |
What does your Podfile look like? Does this happen immediately or only after invoking a server method, or something else? Is it reproducible every time? |
immediately on calling connect method... |
And actually its fixed now.. |
getting error ->
fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=3840 "No value." UserInfo={NSDebugDescription=No value.}: file /Library/Caches/com.apple.xbs/Sources/swiftlang_PONDEROSA/swiftlang_PONDEROSA-700.1.101.6/src/swift/stdlib/public/core/ErrorType.swift, line 50
in SwiftR.swift file
func shouldHandleRequest(request: NSURLRequest) -> Bool {
if request.URL!.absoluteString.hasPrefix("swiftr://") {
let id = (request.URL!.absoluteString as NSString).substringFromIndex(9)
let msg = webView.stringByEvaluatingJavaScriptFromString("readMessage((id))")!
let data = msg.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
let json: AnyObject = try! NSJSONSerialization.JSONObjectWithData(data, options: []) <-- on this line
processMessage(json)
return false
}
return true
}
The text was updated successfully, but these errors were encountered: