forked from CoderMJLee/MJExtension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
服务器如果返回的是JSON字符串,不是JSON对象,有了MJExtension,也可以自动转换为模型了
- Loading branch information
1 parent
da0109d
commit 2da0fc3
Showing
6 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.73 KB
(100%)
...le.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
MJExtensionExample/MJExtensionExample/MJExtension/NSString+MJExtension.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// NSString+MJExtension.h | ||
// TestTabBar | ||
// | ||
// Created by MJ Lee on 15/4/17. | ||
// Copyright (c) 2015年 Mac Z. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSString (MJExtension) | ||
- (id)JSONObject; | ||
@end |
16 changes: 16 additions & 0 deletions
16
MJExtensionExample/MJExtensionExample/MJExtension/NSString+MJExtension.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// NSString+MJExtension.m | ||
// TestTabBar | ||
// | ||
// Created by MJ Lee on 15/4/17. | ||
// Copyright (c) 2015年 Mac Z. All rights reserved. | ||
// | ||
|
||
#import "NSString+MJExtension.h" | ||
|
||
@implementation NSString (MJExtension) | ||
- (id)JSONObject | ||
{ | ||
return [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:nil]; | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters