Skip to content

Commit d4c815d

Browse files
committed
support long type under 32bit
support long type under 32bit
1 parent 7a90796 commit d4c815d

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

MJExtension.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MJExtension"
3-
s.version = "2.5.8"
3+
s.version = "2.5.10"
44
s.ios.deployment_target = '6.0'
55
s.osx.deployment_target = '10.8'
66
s.summary = "The fastest and most convenient conversion between JSON and model"

MJExtension/MJExtensionConst.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
NSString *const MJPropertyTypeShort = @"s";
1111
NSString *const MJPropertyTypeFloat = @"f";
1212
NSString *const MJPropertyTypeDouble = @"d";
13-
NSString *const MJPropertyTypeLong = @"q";
13+
NSString *const MJPropertyTypeLong = @"l";
14+
NSString *const MJPropertyTypeLongLong = @"q";
1415
NSString *const MJPropertyTypeChar = @"c";
1516
NSString *const MJPropertyTypeBOOL1 = @"c";
1617
NSString *const MJPropertyTypeBOOL2 = @"b";

MJExtension/MJPropertyType.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ - (void)setCode:(NSString *)code
5454

5555
// 是否为数字类型
5656
NSString *lowerCode = _code.lowercaseString;
57-
NSArray *numberTypes = @[MJPropertyTypeInt, MJPropertyTypeShort, MJPropertyTypeBOOL1, MJPropertyTypeBOOL2, MJPropertyTypeFloat, MJPropertyTypeDouble, MJPropertyTypeLong, MJPropertyTypeChar];
57+
NSArray *numberTypes = @[MJPropertyTypeInt, MJPropertyTypeShort, MJPropertyTypeBOOL1, MJPropertyTypeBOOL2, MJPropertyTypeFloat, MJPropertyTypeDouble, MJPropertyTypeLong, MJPropertyTypeLongLong, MJPropertyTypeChar];
5858
if ([numberTypes containsObject:lowerCode]) {
5959
_numberType = YES;
6060

MJExtensionExample/MJExtensionExample/Classes/User.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ typedef enum {
2121
/** 年龄 */
2222
@property (assign, nonatomic) unsigned int age;
2323
/** 身高 */
24-
@property (copy, nonatomic) NSString *height;
24+
@property (assign, nonatomic) float height;
2525
/** 财富 */
2626
@property (strong, nonatomic) NSNumber *money;
2727
/** 性别 */

MJExtensionExample/MJExtensionExample/main.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void keyValues2object()
7777
User *user = [User objectWithKeyValues:dict];
7878

7979
// 3.打印User模型的属性
80-
NSLog(@"name=%@, icon=%@, age=%zd, height=%@, money=%@, sex=%d, gay=%d", user.name, user.icon, user.age, user.height, user.money, user.sex, user.gay);
80+
NSLog(@"name=%@, icon=%@, age=%zd, height=%f, money=%@, sex=%d, gay=%d", user.name, user.icon, user.age, user.height, user.money, user.sex, user.gay);
8181
}
8282

8383
/**
@@ -349,7 +349,7 @@ void coreData()
349349
// 利用CoreData保存模型
350350
[context save:nil];
351351

352-
NSLog(@"name=%@, icon=%@, age=%zd, height=%@, money=%@, sex=%d, gay=%d", user.name, user.icon, user.age, user.height, user.money, user.sex, user.gay);
352+
NSLog(@"name=%@, icon=%@, age=%zd, height=%f, money=%@, sex=%d, gay=%d", user.name, user.icon, user.age, user.height, user.money, user.sex, user.gay);
353353
} @catch (NSException *e) {
354354

355355
}

0 commit comments

Comments
 (0)