From 3956a3d8f0968b95133a13058e68d1d736c3f525 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Wed, 27 Jan 2016 17:23:59 +0100 Subject: [PATCH 1/2] no message --- Pod/Classes/PNClasses/PNInstallation.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Pod/Classes/PNClasses/PNInstallation.m b/Pod/Classes/PNClasses/PNInstallation.m index bdf7486..0be0b73 100644 --- a/Pod/Classes/PNClasses/PNInstallation.m +++ b/Pod/Classes/PNClasses/PNInstallation.m @@ -99,9 +99,11 @@ static bool isFirstAccess = YES; if (self) { + _deviceType = @"iOS"; _deviceModel = [[UIDevice currentDevice] model]; - _osVersion = [[UIDevice currentDevice] systemVersion];; - _deviceName = [[UIDevice currentDevice] name];; + _osVersion = [[UIDevice currentDevice] systemVersion]; + _deviceName = [[UIDevice currentDevice] name]; + } return self; } From 114f0dbbaf3a5293ce382a31d4f101658451b298 Mon Sep 17 00:00:00 2001 From: Giuseppe Nucifora Date: Fri, 29 Jan 2016 10:26:55 +0100 Subject: [PATCH 2/2] - Add Class Method PNObjClassName that return che object subclasse name --- Example/PNObject/PNObjectAppDelegate.m | 2 ++ Pod/Classes/PNObject.h | 2 ++ Pod/Classes/PNObject.m | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/Example/PNObject/PNObjectAppDelegate.m b/Example/PNObject/PNObjectAppDelegate.m index fbd578c..87c9481 100644 --- a/Example/PNObject/PNObjectAppDelegate.m +++ b/Example/PNObject/PNObjectAppDelegate.m @@ -50,6 +50,8 @@ [user setLastName:@"Sapienza"]; [user getJSONObject]; + + NSLog(@"%@",[PNUser PNObjClassName]); //NSLog(@"%@",userDictionary); /* diff --git a/Pod/Classes/PNObject.h b/Pod/Classes/PNObject.h index a9c69dc..5ddb6e0 100644 --- a/Pod/Classes/PNObject.h +++ b/Pod/Classes/PNObject.h @@ -26,6 +26,8 @@ @interface PNObject : NSObject ++ (NSString * _Nonnull) PNObjClassName; + - (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON; - (id _Nonnull) saveLocally; diff --git a/Pod/Classes/PNObject.m b/Pod/Classes/PNObject.m index 8310c03..9d69bd9 100644 --- a/Pod/Classes/PNObject.m +++ b/Pod/Classes/PNObject.m @@ -50,6 +50,15 @@ #pragma mark - ++ (NSString * _Nonnull) PNObjClassName { + if ([[self class] resolveClassMethod:@selector(objectClassName)]) { + return [[self class] objectClassName]; + } + else { + return [[super class] objectClassName]; + } +} + - (_Nullable instancetype) init { self = [super init];