views:

195

answers:

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

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

James Skidmore