Skip to content

Instantly share code, notes, and snippets.

@niwatako
Created July 15, 2017 06:43
Show Gist options
  • Save niwatako/1402325a6f3bf732e58273002a15e426 to your computer and use it in GitHub Desktop.
Save niwatako/1402325a6f3bf732e58273002a15e426 to your computer and use it in GitHub Desktop.
static AppDelegate s_sharedApplication;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// request
NSURL *url = [NSURL URLWithString:@"http://xxx.appspot.com/"];
NSURLRequest *request = [NSURLRequest requestWithURL:url
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData //キャッシュ無視
timeoutInterval:30];
NSURLResponse *response = nil;
NSError *error = nil;
NSData *data = [
NSURLConnection
sendSynchronousRequest : request
returningResponse : &response
error : &error
];
if(response){
NSLog(@"%@", response);
} else {
NSString *error_str = [error localizedDescription];
NSLog(@"通信エラー%@", error_str);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment