- Add Class Method PNObjClassName that return che object subclasse name
This commit is contained in:
1 parent
3956a3d8f0
commit
114f0dbbaf
3 files changed
+13
No files matched your search
@@ -26,6 +26,8 @@
|
||||
|
||||
@interface PNObject : NSObject
|
||||
|
||||
+ (NSString * _Nonnull) PNObjClassName;
|
||||
|
||||
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
|
||||
|
||||
- (id _Nonnull) saveLocally;
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in new issue
Block a user