2012-07-25 32 views
1

是否有可能检查iPhone是否通过Wlan连接,通过3G,通过4G或通过2G ?!我知道有从苹果可达类,但你只能检查WLAN或WWAN ...ios可达性

switch (netStatus) 
{ 
    case NotReachable: 
    { 
     statusString = @"Access Not Available"; 
     imageView.image = [UIImage imageNamed: @"stop-32.png"] ; 
     //Minor interface detail- connectionRequired may return yes, even when the host is unreachable. We cover that up here... 
     connectionRequired= NO; 
     break; 
    } 

    case ReachableViaWWAN: 
    { 
     statusString = @"Reachable WWAN"; 
     imageView.image = [UIImage imageNamed: @"WWAN5.png"]; 
     break; 
    } 
    case ReachableViaWiFi: 
    { 
     statusString= @"Reachable WiFi"; 
     imageView.image = [UIImage imageNamed: @"Airport.png"]; 
     break; 
    } 
} 

回答

0

你希望找出属于WWAN(无线广域网)情况下的情况下, 。 有没有官方文件的方式来做到这一点,但Here's a solution that might do the trick,在状态栏上使用私有API

+0

哇,太棒了! Ehm,我是否允许在我的Apps中使用私有API,当我想将它放入Apple Store时? – davidOhara 2012-07-25 12:31:49

+0

不是,这就是为什么他们被称为私有API:( – 2012-07-25 12:34:27

+0

因此,没有办法通过这种分析将应用程序加入商店? – davidOhara 2012-07-25 12:37:14