Created
October 22, 2011 16:25
-
-
Save wilsolutions/1306164 to your computer and use it in GitHub Desktop.
JSON NSLOG output
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)viewDidLoad | |
| { | |
| NSError *error = nil; | |
| // Prepare URL request to JSON call... | |
| NSURLRequest *request = [NSURLRequest requestWithURL: | |
| [NSURL URLWithString: | |
| @"http://reviewapp/items.json"]]; | |
| NSData *response = [NSURLConnection | |
| sendSynchronousRequest:request | |
| returningResponse:nil error:nil]; | |
| // Get JSON as a NSString from NSData response | |
| NSString *json_string = [[NSString alloc]initWithData:response encoding:NSUTF8StringEncoding]; | |
| // output my JSON response? | |
| NSLog(@"JSON: %@", json_string); | |
| [super viewDidLoad]; | |
| self.clearsSelectionOnViewWillAppear = NO; | |
| self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment