I have a dictionary
I need to generate a JSON string
by using dictionary
. Is it possible to convert it? Can you guys please help on this?
相关问题
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- CALayer - backgroundColor flipped?
- how to split a list into a given number of sub-lis
相关文章
- 现在使用swift开发ios应用好还是swift?
- json_encode 没有把数组转为json
- Livy Server: return a dataframe as JSON?
- JSP String formatting Truncate
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Unexpected end of JSON input from an ajax call
- Where does a host app handle NSExtensionContext#co
This one is pretty close to original Objective-C print style
To convert a NSDictionary to a NSString:
In Swift (version 2.0):
Apple added a JSON parser and serializer in iOS 5.0 and Mac OS X 10.7. See NSJSONSerialization.
To generate a JSON string from a NSDictionary or NSArray, you do not need to import any third party framework anymore.
Here is how to do it:
You can also do this on-the-fly by entering the following into the debugger