iOS - NSURLConnection finished with error - code -1002

2402 단어
       ,    :Error domain: @"NSURLErrorDomain" - code: 1002

           ,             : po error
    :**[Error Domain=NSURLErrorDomain Code=-1002 ] "unsupported URL" **
*Error Domain=NSURLErrorDomain Code=-1002 "unsupported URL" UserInfo={NSLocalizedDescription=unsupported URL, NSUnderlyingError=0x7fa9b1d06120 {Error Domain=kCFErrorDomainCFNetwork Code=-1002 "(null)"}}  *      url    ,    URL     

“/”,

http://gwtest.opg-iot.com:8000//api-sdeventApplication/images/handle/event_result/event_result_beimg_20190522093224_0.jpeg?Authenticator=eyJhbGciOiJIUzI1NiJ9.eyJyZWFsTmFtZSI6bnVsbCwibG9naW5OYW1lIjoiU0Q3MzkzIiwidXNlclR5cGUiOiIxIiwicGxhdGZvcm1JZCI6MTAsImV4cCI6MTU1OTA5MzkxOSwidXNlcklkIjo3MzkzfQ.KieGb8LUsgpvn9BU9jjSiNSNn12irclYKiPH_s0Uqgk
 

 
    :


iOS 8   utf8  :

urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];


iOS 8         :

urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"#%^{}\"[]|\\<> "].invertedSet];

 
전재 대상:https://www.cnblogs.com/gongyuhonglou/p/10904100.html

좋은 웹페이지 즐겨찾기