Comments (6)
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))
}
}
from swiftyjson.
Thats the first thing I tried BUT I got the following error:
'NSString' is not convertible to 'UInt8'
By the way I just copied the swift code into a swift file in one of my projects to play around...
from swiftyjson.
@fabriciomrtnz make sure to recast breadcrumb as String to get the + operator support.
from swiftyjson.
Yep that did the trick. Its compiling, let see if it works.
-Thanks Matt
from swiftyjson.
I had the same problem. Changing String
to NSString
solved the issue. Thanks :)
from swiftyjson.
worked for me as well in Xcode 6 Beta 3
from swiftyjson.
Related Issues (20)
- How to test if a property exists on a JSON object? HOT 1
- How to read emojis in JSON
- Warning that in Swift 6 will be an error HOT 13
- Type 'Any' is not optional, value can never be nil; this is an error in Swift 6 HOT 2
- How to update a field of a SwiftyJSON object
- New version release - When? HOT 11
- Json cert
- Recommended way to conform `JSON` to `Hashable` HOT 4
- Empty dictionary object cannot insert data HOT 2
- unwrap crash HOT 1
- Privacy manifest required by Apple HOT 9
- Errors in readme HOT 1
- Privacy Manifest HOT 5
- Is this repository no longer maintained? why? HOT 4
- STACK CANARY problem
- Privacy manifest for application
- PrivacyInfo file HOT 1
- Update to 5.0.2 with cocoapods HOT 10
- Private library that relies on SwiftyJSON, pod lib lint cannot pass HOT 8
- 特殊符号
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftyjson.