what is the best way to load a different source fil开发者_开发技巧e over 3G connection than over WIFI?
thanx
Apple's Reachability
Follow the ReadMe and include the necessary frameworks. Then use the code sample below:
NetworkStatus status = [[Reachability reachabilityForInternetConnection] currentReachabilityStatus];
if (status == ReachableViaWiFi) {
// wifi connection
if (status == ReachableViaWWAN) {
// wwan connection (could be GPRS, 2G or 3G)
} else {
// no network
}
If you are designing a web application, the connection type cannot be determined.
If you by resources mean video or audio streams then consider providing HTTP streaming resources from your server. This way the frameworks will choose what is best for the current connection, and even update the source if the connection status changes.
Read more here: https://developer.apple.com/streaming/
精彩评论