- Add Class Method PNObjClassName that return che object subclasse name
This commit is contained in:
parent
3956a3d8f0
commit
114f0dbbaf
@ -50,6 +50,8 @@
|
|||||||
[user setLastName:@"Sapienza"];
|
[user setLastName:@"Sapienza"];
|
||||||
|
|
||||||
[user getJSONObject];
|
[user getJSONObject];
|
||||||
|
|
||||||
|
NSLog(@"%@",[PNUser PNObjClassName]);
|
||||||
//NSLog(@"%@",userDictionary);
|
//NSLog(@"%@",userDictionary);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
@interface PNObject : NSObject
|
@interface PNObject : NSObject
|
||||||
|
|
||||||
|
+ (NSString * _Nonnull) PNObjClassName;
|
||||||
|
|
||||||
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
|
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
|
||||||
|
|
||||||
- (id _Nonnull) saveLocally;
|
- (id _Nonnull) saveLocally;
|
||||||
|
|||||||
@ -50,6 +50,15 @@
|
|||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
|
|
||||||
|
+ (NSString * _Nonnull) PNObjClassName {
|
||||||
|
if ([[self class] resolveClassMethod:@selector(objectClassName)]) {
|
||||||
|
return [[self class] objectClassName];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return [[super class] objectClassName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (_Nullable instancetype) init {
|
- (_Nullable instancetype) init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user