/ Published in: iPhone

Simple synchronous web request for ios.
// Credit to the original authors:
// Sam Walton
// Ethan Irish
// www.seven-labs.com
// Be kind & share :)
// Credit to the original authors:
// Sam Walton
// Ethan Irish
// www.seven-labs.com
// Be kind & share :)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Quick synchronous URL request NSURLResponse *response; NSError *error; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; // need to check for errors, like if it was a bad call there will be no responsestring // but your error will have some data if(!error) { NSLog(@"response = %@", responseString); // Take all data and split into array by comma // Just a test var called testItem at the index of 10 NSLog(@"test item at 10 = %@", testItem); } // Authors: // Sam Walton // Ethan Irish // www.seven-labs.com // Be kind & share :)
Comments
