Skip to content

Commit

Permalink
修复用keyPath方式取原生类型值导致错误bug
Browse files Browse the repository at this point in the history
  • Loading branch information
netyouli committed Dec 1, 2016
1 parent 459c3f5 commit 99564bb
Show file tree
Hide file tree
Showing 9 changed files with 364 additions and 316 deletions.
Binary file not shown.
Expand Up @@ -48,32 +48,16 @@
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ModelBenchmark/ViewController.m"
timestampString = "502184039.506235"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "47"
endingLineNumber = "47"
landmarkName = "-viewDidLoad"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ModelBenchmark/ViewController.m"
timestampString = "502184167.962187"
filePath = "ModelBenchmark/WHC_Model/NSObject+WHC_Model.m"
timestampString = "502255713.521106"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "46"
endingLineNumber = "46"
landmarkName = "-viewDidLoad"
startingLineNumber = "668"
endingLineNumber = "668"
landmarkName = "+classExistProperty:withObject:valueClass:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
Expand Down
64 changes: 52 additions & 12 deletions Benchmark/ModelBenchmark/Test.json
@@ -1,13 +1,53 @@
{
"status" : {
"msg" : "succ",
"code" : 0
},
"data" : [
"吞天记",
"谢家皇后",
"乱世宏图",
"老婆是武林盟主"
],
"token" : ""
}
"status": {
"code": 0,
"msg": "succ"
},
"num": 10,
"cur_page": 1,
"total_num": 1,
"total_page": 10,
"data": [
{
"value": "3",
"key": "仙侠"
},
{
"value": "3",
"key": "仙侠传人生路"
},
{
"value": "3",
"key": "仙侠六界"
},
{
"value": "3",
"key": "仙侠奇缘之凤千灵"
},
{
"value": "3",
"key": "仙侠道"
},
{
"value": "2",
"key": "仙侠一世之神果转世"
},
{
"value": "2",
"key": "仙侠世界大冒险"
},
{
"value": "2",
"key": "仙侠之命安彼生"
},
{
"value": "2",
"key": "仙侠之路"
},
{
"value": "2",
"key": "仙侠奇缘"
}
],
"token": ""
}
4 changes: 2 additions & 2 deletions Benchmark/ModelBenchmark/ViewController.m
Expand Up @@ -42,10 +42,10 @@ - (void)viewDidLoad {
NSData *data = [NSData dataWithContentsOfFile:path];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];

NSArray * testArray = [NSString whc_ModelWithJson:json keyPath:@"data"];
NSArray * testArray = [NSDictionary whc_ModelWithJson:json keyPath:@"data"];
NSLog(@"test = %@",testArray);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//[self benchmarkGithubUser];
[self benchmarkGithubUser];
[self benchmarkWeiboStatus];

// [self testRobustness];
Expand Down
288 changes: 150 additions & 138 deletions Benchmark/ModelBenchmark/WHC_Model/NSObject+WHC_Model.m

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -33,7 +33,7 @@ Time lost (Benchmark 1000 times)
集成
==============
* 使用CocoaPods:
- pod 'WHC_Model', '~> 1.6.2'
- pod 'WHC_Model', '~> 1.6.3'
* 手工集成:
- 导入文件夹WHC_ModelKit

Expand Down
4 changes: 2 additions & 2 deletions WHC_Model.podspec
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "WHC_Model"
s.version = "1.6.2"
s.version = "1.6.3"
s.summary = "iOS平台高效转换引擎json->model,model->json,model->Dictionary,支持模型类继承其他模型类,支持指定路径转换,不区分json的key和模型属性名称大小写,自动处理json中null"

s.homepage = "https://github.com/netyouli/WHC_Model"
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.platform = :ios
s.platform = :ios, "6.0"

s.source = { :git => "https://github.com/netyouli/WHC_Model.git", :tag => "1.6.2"}
s.source = { :git => "https://github.com/netyouli/WHC_Model.git", :tag => "1.6.3"}

s.source_files = "WHC_ModelKit/*.{h,m}"

Expand Down
Binary file not shown.

0 comments on commit 99564bb

Please sign in to comment.