- Add subclassing
This commit is contained in:
parent
e2e17186ac
commit
75966e2a94
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="whP-gf-Uak">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<!--Object View Controller-->
|
||||
<scene sceneID="wQg-tq-qST">
|
||||
<objects>
|
||||
<viewController id="whP-gf-Uak" customClass="PNObjectViewController" sceneMemberID="viewController">
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
// Override point for customization after application launch.
|
||||
[PNObjectConfig initSharedInstanceForEnvironments:@{ EnvironmentDevelopment : @"https://development.it/api/v1",
|
||||
/*[PNObjectConfig initSharedInstanceForEnvironments:@{ EnvironmentDevelopment : @"https://development.it/api/v1",
|
||||
EnvironmentStage : @"https://stage.it/api/v1",
|
||||
EnvironmentProduction : @"http://pnobjectdemo.giuseppenucifora.com/"
|
||||
}];
|
||||
@ -22,7 +22,7 @@
|
||||
[[PNObjectConfig sharedInstance] setEnvironment:Production];
|
||||
|
||||
|
||||
[PNObject get];
|
||||
[PNObject get];*/
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user