- Add subclassing
This commit is contained in:
1 parent
e2e17186ac
commit
75966e2a94
6 files changed
+6
-34
No files matched your search
@@ -19,5 +19,4 @@
|
||||
|
||||
- (instancetype) initWithJSON:(NSDictionary*) JSON;
|
||||
|
||||
+ (void) get;
|
||||
@end
|
||||
@@ -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];
|
||||
|
||||
|
||||
@@ -17,4 +17,5 @@
|
||||
|
||||
+ (NSDictionary *) objcetMapping;
|
||||
|
||||
|
||||
@end
|
||||
@@ -31,6 +31,4 @@
|
||||
@property (nonatomic, strong) NSString *facebookAccessToken;
|
||||
@property (nonatomic, strong) PNAddress *address;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user