- Add subclassing

This commit is contained in:
giuseppenuc committed 2016-01-15 17:45:16 +01:00
1 parent e2e17186ac
commit 75966e2a94
6 files changed
+6 -34

No files matched your search

-1
View File
@@ -19,5 +19,4 @@
- (instancetype) initWithJSON:(NSDictionary*) JSON;
+ (void) get;
@end
-26
View File
@@ -22,32 +22,6 @@
@implementation PNObject
+ (void) get {
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeCertificate];
manager.securityPolicy.allowInvalidCertificates = YES;
[manager GET:[[[PNObjectConfig sharedInstance] PNObjEndpoint] stringByAppendingFormat:@"%@",@"User"] parameters:nil progress:nil success:^(NSURLSessionTask *task, id responseObject) {
NSLog(@"JSON: %@", responseObject);
NSLog(@"JSON: %@", [responseObject class]);
PNUser *user = [[PNUser alloc] initWithJSON:responseObject];
NSLog(@"%@",user);
} failure:^(NSURLSessionTask *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
}
- (instancetype) init {
self = [super init];
+1
View File
@@ -17,4 +17,5 @@
+ (NSDictionary *) objcetMapping;
@end
-2
View File
@@ -31,6 +31,4 @@
@property (nonatomic, strong) NSString *facebookAccessToken;
@property (nonatomic, strong) PNAddress *address;
@end