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/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; } 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];