This commit is contained in:
giuseppenuc committed 2016-01-16 15:36:06 +01:00
1 parent 58784dda8a
commit df529258e0
5 files changed
+33 -7

No files matched your search

+17 -6
View File
@@ -37,16 +37,29 @@ static bool isFirstAccess = YES;
}
- (NSString * _Nullable) objectName:(id _Nonnull) object {
NSString *className;
BOOL isPNObjectSubclass = [[object class] isSubclassOfClass:[PNObject class]];
if(isPNObjectSubclass) {
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)] && [(PNObject*)[object subClassDelegate] respondsToSelector:@selector(objectClassName)]) {
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
return className = (NSString *)[[(PNObject*)object class] performSelector:@selector(objectClassName)];
NSLogDebug(@"%@",[object subClassDelegate]);
//if ([[object subClassDelegate] respondsToSelector:@selector(objectClassName)]) {
@try {
return (NSString *)[[object class] performSelector:@selector(objectClassName)];
}
@catch (NSException *exception) {
return nil;
}
@finally {
}
//}
}
}
return nil;
@@ -117,12 +130,10 @@ static bool isFirstAccess = YES;
if ([[object class] conformsToProtocol:@protocol(PNObjectSubclassing)]) {
id value;
SEL selector = NSSelectorFromString(@"getObject");
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[[PNObject class] instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:value];
[invocation setTarget:object];
[invocation invoke];
NSDictionary *objectDict;
+7
View File
@@ -71,9 +71,16 @@ static bool isFirstAccess = YES;
[self doesNotRecognizeSelector:_cmd];
}
self = [super init];
if (self) {
[self setSubClassDelegate:self];
}
return self;
}
- (void) setEmail:(NSString *)email {
}
#pragma mark PNObjectSubclassing Protocol
+ (NSDictionary *)objcetMapping {