Skip to content

Instantly share code, notes, and snippets.

@Moligaloo
Created September 10, 2012 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Moligaloo/3689649 to your computer and use it in GitHub Desktop.
Save Moligaloo/3689649 to your computer and use it in GitHub Desktop.
Get global IP in Objective-C
NSError *error;
NSURL *ipURL = [NSURL URLWithString:@"http://automation.whatismyip.com/n09230945.asp"];
NSString *ip = [NSString stringWithContentsOfURL:ipURL encoding:NSUTF8StringEncoding error:&error];
NSLog(@"IP:%@",ip);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment