- Add subclassing

This commit is contained in:
Giuseppe Nucifora 2016-01-15 17:45:16 +01:00
parent e2e17186ac
commit 75966e2a94
6 changed files with 6 additions and 34 deletions

View File

@ -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">

View File

@ -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;
}

View File

@ -19,5 +19,4 @@
- (instancetype) initWithJSON:(NSDictionary*) JSON;
+ (void) get;
@end

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];

View File

@ -17,4 +17,5 @@
+ (NSDictionary *) objcetMapping;
@end

View File

@ -31,6 +31,4 @@
@property (nonatomic, strong) NSString *facebookAccessToken;
@property (nonatomic, strong) PNAddress *address;
@end