Category Archives: XCode

Objective-C Http request response

NSURL *url = [NSURL URLWithString:@”https://www.google.com/accounts/ClientLogin”]; NSMutableURLRequest *loginRequest = [NSMutableURLRequest requestWithURL:url]; [loginRequest setHTTPMethod:@”POST”]; [loginRequest addValue:@”Content-Type” forHTTPHeaderField:@”application/x-www-form-urlencoded”]; [loginRequest addValue:@”application/x-www-form-urlencoded” forHTTPHeaderField:@”Content-Type”]; NSString *requestBody = [[NSString alloc] initWithFormat:@”Email=%@&Passwd=%@&service=finance&source=%@”, @”mars”, @”1234″, [NSString stringWithFormat:@”%@%d”, @”ashlux-igFinance-1.0″]]; [loginRequest setHTTPBody:[requestBody dataUsingEncoding:NSASCIIStringEncoding]]; NSHTTPURLResponse *response = NULL; NSData *responseData = [NSURLConnection sendSynchronousRequest:loginRequest returningResponse:&response error:nil]; NSString *responseDataString = [[NSString alloc] initWithData:responseData encoding:NSASCIIStringEncoding]; NSLog(@”Response from Google: %@”, responseDataString);

XCode Uninstall Command

터미널을 띄우고sudo /Developer/Library/uninstall-devtools –mode=all 깔끔하게 지워진다.. 좀 오래 걸리는게 단점..!!