21.網(wǎng)絡(luò)服務(wù)類型NSURLRequestNetworkServiceType
示例代碼:
typedef NS_ENUM(NSUInteger, NSURLRequestNetworkServiceType) { NSURLNetworkServiceTypeDefault = 0, // Standard internet traffic NSURLNetworkServiceTypeVoIP = 1, // Voice over IP control traffic NSURLNetworkServiceTypeVideo = 2, // Video traffic NSURLNetworkServiceTypeBackground = 3, // Background traffic NSURLNetworkServiceTypeVoice = 4 // Voice data};
可以通過這個值來指定當(dāng)前的網(wǎng)絡(luò)類型,系統(tǒng)會跟據(jù)制定的網(wǎng)絡(luò)類型對很多方面進(jìn)行優(yōu)化,這個就設(shè)計到很細(xì)微的編程技巧了,可作為一個優(yōu)化的點備用。