- fix mapping object
This commit is contained in:
parent
55b822bd51
commit
05c95a6e4a
@ -38,7 +38,7 @@ PODS:
|
|||||||
- NSString-Helper (1.0.6)
|
- NSString-Helper (1.0.6)
|
||||||
- nv-ios-http-status (0.0.1)
|
- nv-ios-http-status (0.0.1)
|
||||||
- PEAR-FileManager-iOS (1.3.1)
|
- PEAR-FileManager-iOS (1.3.1)
|
||||||
- PNObject (2.4.5):
|
- PNObject (2.5):
|
||||||
- AFNetworking
|
- AFNetworking
|
||||||
- CodFis-Helper
|
- CodFis-Helper
|
||||||
- DDDKeychainWrapper
|
- DDDKeychainWrapper
|
||||||
@ -85,7 +85,7 @@ SPEC CHECKSUMS:
|
|||||||
NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7
|
NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7
|
||||||
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
||||||
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
||||||
PNObject: e754ef3f56399808cdb48af39d610c8132f2effe
|
PNObject: 8ca962a9c8cf4c00bdf3815bd52637ffd4fb4148
|
||||||
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
|
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
|
||||||
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
|
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
|
||||||
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
|
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "PNObject",
|
"name": "PNObject",
|
||||||
"version": "2.4.5",
|
"version": "2.5",
|
||||||
"summary": "PNObject is a simple replica of the more complex ParseObject",
|
"summary": "PNObject is a simple replica of the more complex ParseObject",
|
||||||
"homepage": "https://github.com/giuseppenucifora/PNObject",
|
"homepage": "https://github.com/giuseppenucifora/PNObject",
|
||||||
"license": {
|
"license": {
|
||||||
@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"git": "https://github.com/giuseppenucifora/PNObject.git",
|
"git": "https://github.com/giuseppenucifora/PNObject.git",
|
||||||
"tag": "2.4.5"
|
"tag": "2.5"
|
||||||
},
|
},
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"ios": "8.0"
|
"ios": "8.0"
|
||||||
|
|||||||
4
Example/Pods/Manifest.lock
generated
4
Example/Pods/Manifest.lock
generated
@ -38,7 +38,7 @@ PODS:
|
|||||||
- NSString-Helper (1.0.6)
|
- NSString-Helper (1.0.6)
|
||||||
- nv-ios-http-status (0.0.1)
|
- nv-ios-http-status (0.0.1)
|
||||||
- PEAR-FileManager-iOS (1.3.1)
|
- PEAR-FileManager-iOS (1.3.1)
|
||||||
- PNObject (2.4.5):
|
- PNObject (2.5):
|
||||||
- AFNetworking
|
- AFNetworking
|
||||||
- CodFis-Helper
|
- CodFis-Helper
|
||||||
- DDDKeychainWrapper
|
- DDDKeychainWrapper
|
||||||
@ -85,7 +85,7 @@ SPEC CHECKSUMS:
|
|||||||
NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7
|
NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7
|
||||||
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
|
||||||
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
|
||||||
PNObject: e754ef3f56399808cdb48af39d610c8132f2effe
|
PNObject: 8ca962a9c8cf4c00bdf3815bd52637ffd4fb4148
|
||||||
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
|
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
|
||||||
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
|
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
|
||||||
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
|
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'PNObject'
|
s.name = 'PNObject'
|
||||||
s.version = '2.4.5'
|
s.version = '2.5'
|
||||||
s.summary = 'PNObject is a simple replica of the more complex ParseObject'
|
s.summary = 'PNObject is a simple replica of the more complex ParseObject'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -142,7 +142,15 @@
|
|||||||
NSMutableArray *arr = [NSMutableArray array];
|
NSMutableArray *arr = [NSMutableArray array];
|
||||||
for(id JSONObject in value) {
|
for(id JSONObject in value) {
|
||||||
if(fromLocal || [[JSONObject class] isSubclassOfClass:[PNObject class]] || [NSClassFromString(mappedJSONType) isSubclassOfClass:[PNObject class]]) {
|
if(fromLocal || [[JSONObject class] isSubclassOfClass:[PNObject class]] || [NSClassFromString(mappedJSONType) isSubclassOfClass:[PNObject class]]) {
|
||||||
PNObject *val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject fromLocal:fromLocal];
|
PNObject *val;
|
||||||
|
|
||||||
|
if ([JSONObject isKindOfClass:[NSDictionary class]]) {
|
||||||
|
val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject fromLocal:fromLocal];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = [[NSClassFromString(mappedJSONType) alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
[arr addObject:val];
|
[arr addObject:val];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -156,7 +164,15 @@
|
|||||||
NSMutableArray *arr = [NSMutableArray array];
|
NSMutableArray *arr = [NSMutableArray array];
|
||||||
for(id JSONObject in value) {
|
for(id JSONObject in value) {
|
||||||
if(fromLocal || [[JSONObject class] isSubclassOfClass:[PNObject class]] || [NSClassFromString(mappedJSONType) isSubclassOfClass:[PNObject class]]) {
|
if(fromLocal || [[JSONObject class] isSubclassOfClass:[PNObject class]] || [NSClassFromString(mappedJSONType) isSubclassOfClass:[PNObject class]]) {
|
||||||
PNObject *val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject fromLocal:fromLocal];
|
PNObject *val;
|
||||||
|
|
||||||
|
if ([JSONObject isKindOfClass:[NSDictionary class]]) {
|
||||||
|
val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject fromLocal:fromLocal];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = [[NSClassFromString(mappedJSONType) alloc] init];
|
||||||
|
}
|
||||||
|
//PNObject *val = [[NSClassFromString(mappedJSONType) alloc] initWithJSON:JSONObject fromLocal:fromLocal];
|
||||||
[arr addObject:val];
|
[arr addObject:val];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -171,8 +187,14 @@
|
|||||||
BOOL isPNObjectSubclass = [NSClassFromString(propertyType) isSubclassOfClass:[PNObject class]];
|
BOOL isPNObjectSubclass = [NSClassFromString(propertyType) isSubclassOfClass:[PNObject class]];
|
||||||
|
|
||||||
if(isPNObjectSubclass) {
|
if(isPNObjectSubclass) {
|
||||||
|
PNObject *val;
|
||||||
|
if ([value isKindOfClass:[NSDictionary class]]) {
|
||||||
|
val = [[NSClassFromString(propertyType) alloc] initWithJSON:value fromLocal:fromLocal];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = [[NSClassFromString(propertyType) alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
PNObject *val = [[NSClassFromString(propertyType) alloc] initWithJSON:value fromLocal:fromLocal];
|
|
||||||
[self setValue:val forKey:propertyName];
|
[self setValue:val forKey:propertyName];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user