-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Code does not compile in iOS 8 Beta 3. #17
Comments
Interesting, the error goes away if I conditionally cast it to NSString. if let userInfo = error.userInfo{
if let breadcrumb = userInfo["JSONErrorBreadCrumbKey"] as? NSString{
let newBreadCrumb = (breadcrumb as String) + "/\(index)"
let newUserInfo = [NSLocalizedDescriptionKey: "JSON Keypath Error: Incorrect Keypath \"\(newBreadCrumb)\"",
"JSONErrorBreadCrumbKey": newBreadCrumb]
return JSONValue.JInvalid(NSError(domain: "JSONErrorDomain", code: 1002, userInfo: newUserInfo))
}
} |
Thats the first thing I tried BUT I got the following error: By the way I just copied the swift code into a swift file in one of my projects to play around... |
@fabriciomrtnz make sure to recast breadcrumb as String to get the + operator support. |
Yep that did the trick. Its compiling, let see if it works. -Thanks Matt |
I had the same problem. Changing |
worked for me as well in Xcode 6 Beta 3 |
* Kitura/Kitura#675 Required rename of test module and update of Swift version * Kitura/Kitura#675 Swift language changes * Kitura/Kitura#675 Foundation changes * Kitura/Kitura#675 Changes for Linux * Kitura/Kitura#675 Changes to get Bool working on OSX * Kitura/Kitura#678 Changes to get tests to work on OSX * Kitura/Kitura#678 Changes to get tests compiling on OSX * Kitura/Kitura#675 Test module name changed * Kitura/Kitura#675 Fix Dictionaries on macOS * Kitura/Kitura#675 Fix Arrays on macOS * Kitura/Kitura#675 Test module name changed * Kitura/Kitura#675 rawValue of Bools is now a Bool. They can't be cast to Int or Double. * Kitura/Kitura#675 Class of some NSNumber's has changed. compare fails. * Kitura/Kitura#675 replaced bridge() with new bridge functions _bridgeToSwift and _bridgeToObjectiveC * Kitura/Kitura#675 changed signature of dictionary.enumerateKeysAndObjects to dictionary.enumerateKeysAndObjects(using: {(key: Any, val: Any, stop: UnsafeMutablePointer<ObjCBool>) * Kitura/Kitura#675 unified String.addingPercentEncoding on both Linux and macOS * Kitura/Kitura#675 one more case of bridge() changed to _bridgeToObjectiveC() * Kitura/Kitura#675 removed redundant whitespace * Kitura/Kitura#675 unified String.addingPercentEncoding on both Linux and macOS * Kitura/Kitura#675 cast to String instead of NSString of the key in enumerateKeysAndObjects * DEVELOPMENT-SNAPSHOT-2016-08-18-a * Kitura/Kitura#675 removed Indexable it will be deprecated in Swift 4.0, implementing Collection is enough * Kitura/Kitura#697 Updated Swift version
The following line is returning an error:
if let breadcrumb = userInfo["JSONErrorBreadCrumbKey"] as? String{
Error:
'String' is not a subtype of '(NSObject, AnyObject)'
The text was updated successfully, but these errors were encountered: