21.網絡服務類型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};
可以通過這個值來指定當前的網絡類型,系統(tǒng)會跟據制定的網絡類型對很多方面進行優(yōu)化,這個就設計到很細微的編程技巧了,可作為一個優(yōu)化的點備用。