Skip to content

Commit d88fcf2

Browse files
author
Jérôme Lebel
committed
use the host name instead of the ip (no more dependant to an interface, yeah \!)
1 parent 422e250 commit d88fcf2

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Sources/MainViewController.m

+1-9
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,7 @@ - (void) viewDidLoad
7777

7878
- (void) ping
7979
{
80-
#if TARGET_IPHONE_SIMULATOR
81-
self.ip = [[UIDevice currentDevice] IPAddressForInterface:@"en1"];
82-
if (!self.ip) {
83-
self.ip = [[UIDevice currentDevice] IPAddressForInterface:@"en2"];
84-
}
85-
#else
86-
self.ip = [[UIDevice currentDevice] IPAddressForInterface:@"en0"];
87-
#endif
88-
80+
self.ip = [[NSProcessInfo processInfo] hostName];
8981
if (self.ip != nil) {
9082

9183
httpAddressLabel.text = [NSString stringWithFormat:@"%@:%d", self.ip, HTTP_PROXY_PORT];

0 commit comments

Comments
 (0)