- Add Class Method PNObjClassName that return che object subclasse name

This commit is contained in:
giuseppenuc committed 2016-01-29 10:26:55 +01:00
1 parent 3956a3d8f0
commit 114f0dbbaf
3 files changed
+13

No files matched your search

+2
View File
@@ -26,6 +26,8 @@
@interface PNObject : NSObject
+ (NSString * _Nonnull) PNObjClassName;
- (_Nullable instancetype) initWithJSON:( NSDictionary * _Nonnull) JSON;
- (id _Nonnull) saveLocally;
+9
View File
@@ -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];