本文介绍了苹果当前的可达性类是否与iOS 3.1向后兼容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在实施Apple的可达性类添加到我的应用程序中.该应用程序的基本SDK是iOS 4.0,其部署目标是iOS 3.1.

I'm implementing Apple's Reachibility class into my application. The app's base SDK is iOS 4.0, and its deployment target is iOS 3.1.

我没有要测试的3.1设备,因此谁能告诉我它是否向后兼容?可达性文档说,iOS 4.0是必需的,因此,如果确实确实需要最低版本4.0,我如何才能使其在3.1上运行?

I do not have a 3.1 device to test with, so can anyone tell me if it is backwards compatible? The documents for Reachability say that iOS 4.0 is required, so if it does indeed need a minimum of 4.0, how can I make it work on 3.1?

我正在做的只是测试看看它们是否已连接到WiFi网络.由于苹果的新限制(我目前不打算实现其HTTP Live Streaming),因此我不得不将流视频限制为WiFi.

All I'm doing is testing to see if they are connected to a WiFi network. I'm having to limit streaming video to WiFi only because of Apple's new restrictions (not looking to implement their HTTP Live Streaming at this time).

这是我正在使用的代码,因此,如果您可以确保没有任何问题,我也将不胜感激.在iOS 4.0上可以正常使用,但是我注意到有人说这可能会导致崩溃?

Here is the code I'm using, so I also would appreciate it if you could make sure that there isn't anything wrong with this. It works fine on iOS 4.0, but I noticed someone saying that it could cause a crash?

Reachability *reachability = [Reachability reachabilityWithHostName:@"www.apple.com"];
NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus];
if (remoteHostStatus != ReachableViaWiFi)
{
  ...
}

推荐答案

从未找到答案,但是我实现了安德鲁·多诺霍(Andrew Donoho)的课程版本,在iOS 3.1.2上运行良好.

Never found an answer, but I implemented Andrew Donoho's version of the class and it worked fine on iOS 3.1.2.

这篇关于苹果当前的可达性类是否与iOS 3.1向后兼容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!