Created
July 15, 2017 06:43
-
-
Save niwatako/1402325a6f3bf732e58273002a15e426 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
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