Created
March 10, 2012 22:19
-
-
Save kylefox/2013602 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)realAuthenticate { | |
NSURLRequest *request = [self getURLRequest]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request | |
success:^( NSURLRequest *request , NSHTTPURLResponse *response , id JSON ) { | |
NSString *domain = [[(NSArray *)[JSON objectForKey:@"sites"] lastObject] objectForKey:@"domain"]; | |
Portfolio *portfolio = [[Portfolio alloc] init]; | |
portfolio.domain = domain; | |
self.portfolio = portfolio; | |
[self finishAuth:YES]; | |
} | |
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { | |
[self finishAuth:NO]; | |
}]; | |
[operation start]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment