標籤:inf table res code config nbsp size type insecure
1.建立新項目用到 進行網路請求請求時,報下面的錯:
“App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app’s Info.plist file”
解決辦法:
1、在Info.plist中添加 NSAppTransportSecurity 類型 Dictionary ;
2、在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 類型Boolean ,值設為 YES;
2.使用AFNetworking 3.0+版本進行網路請求,報如下錯誤:
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x60000002db00>
解決辦法:
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.responseSerializer = [AFHTTPResponseSerializer new];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", nil];
持續更新...
iOS開發遇到的那些bug