Permalink
Browse files

use the host name instead of the ip (no more dependant to an interfac…

…e, yeah \!)
  • Loading branch information...
1 parent 422e250 commit d88fcf2dde1fcee70e59c11bab643f69a89ab125 J��r��me Lebel committed Oct 3, 2010
Showing with 1 addition and 9 deletions.
  1. +1 −9 Sources/MainViewController.m
View
10 Sources/MainViewController.m
@@ -77,15 +77,7 @@ - (void) viewDidLoad
- (void) ping
{
-#if TARGET_IPHONE_SIMULATOR
- self.ip = [[UIDevice currentDevice] IPAddressForInterface:@"en1"];
- if (!self.ip) {
- self.ip = [[UIDevice currentDevice] IPAddressForInterface:@"en2"];
- }
-#else
- self.ip = [[UIDevice currentDevice] IPAddressForInterface:@"en0"];
-#endif
-
+ self.ip = [[NSProcessInfo processInfo] hostName];
if (self.ip != nil) {
httpAddressLabel.text = [NSString stringWithFormat:@"%@:%d", self.ip, HTTP_PROXY_PORT];

0 comments on commit d88fcf2

Please sign in to comment.