Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netyouli/whc_json
自动把字典转换为json
https://github.com/netyouli/whc_json
Last synced: about 1 month ago
JSON representation
自动把字典转换为json
- Host: GitHub
- URL: https://github.com/netyouli/whc_json
- Owner: netyouli
- Created: 2015-05-04T03:37:08.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-04T07:58:20.000Z (over 9 years ago)
- Last Synced: 2023-03-01T16:55:56.672Z (almost 2 years ago)
- Language: Objective-C
- Size: 121 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WHC_Json
自动把字典转换为json
####Use Example
```objective-c
NSDictionary * dict = @{
@"weatherinfo":@{
@"city":@"武汉",
@"cityid":@"101010100",
@"img1":@"d1.gif",
@"img2" : @"n1.gif",
@"ptime" :@"08:00",
@"temp1" : @"15",
@"temp2" : @"5",
@"weather" : @"hao"
}
};
NSString * jsonString = [WHC_Json jsonWithDictionary:dict];
NSLog (@"jsonString = %@",jsonString);
//jsonString = {\"weatherinfo\":{\"city\":\"北京\",\"cityid\":\"101010100\",\"temp1\":\"15℃\",\"temp2\":\"5℃\",\"weather\":\"多云\",\"img1\":\"d1.gif\",\"img2\":\"n1.gif\",\"ptime\":\"08:00\"}}
```