From ac846a45768680133e98026f811801289759914c Mon Sep 17 00:00:00 2001 From: zhzenghui Date: Thu, 20 Nov 2014 17:15:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0en0=20en1=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WhatIsMyIP/IPDetector.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WhatIsMyIP/IPDetector.m b/WhatIsMyIP/IPDetector.m index db9e9cf..10dc020 100644 --- a/WhatIsMyIP/IPDetector.m +++ b/WhatIsMyIP/IPDetector.m @@ -72,6 +72,8 @@ + (NSString *)getIPAddress while (temp_addr != NULL) { if( temp_addr->ifa_addr->sa_family == AF_INET) { // Check if interface is en0 which is the wifi connection on the iPhone + // en0 iOS wifi + // en1 OS X wifi if ([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) { // Get NSString from C String address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)];