1

是否有可能检查 iphone 是否通过 Wlan、3g、4g 或 2g 连接?!我知道苹果有一个可达性类,但是你只能检查 Wlan 还是 wwan ......

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;
  }
}
4

1 回答 1

0

您要识别的案例属于 WWAN(无线广域网)案例。没有官方记录的方法可以做到这一点,但这是一个可以解决问题的解决方案,在状态栏上使用私有 API

于 2012-07-25T12:24:15.150 回答