开发者

Is Apple's current Reachability class backwards-compatible with 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.

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?

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).

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)
{
  ...
}


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜