ITeye博客

How do I fix NSURLErrorDomain error -999 in iPhone 3.0 OS

handy.wang · 2011-01-22 21:58 · Mac · 移动开发 · HTML · OS · Web · thread · Markdown

Comment1####################################

I was able to find the answer here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/6280-uiwebview-didfailloadwitherror-how-get-errors-code-list.html

 

This thread contained this description for this error: "This error may occur if an another request is made before the previous request of WebView is completed..."

 

I worked around this by ignoring this error and letting the webview continue to load.

if ([error code] != -999) { //show error alert, etc. }

 

Comment2####################################

"Returned when an asynchronous load is canceled. A Web Kit framework delegate will receive this error when it performs a cancel operation on a loading resource. Note that an NSURLConnection or NSURLDownload delegate will not receive this error if the download is canceled."

For my situation (and probably yours) this can be ignored:

if
([
error code
]
 
==
 
NSURLErrorCancelled
)
 
return
;
 
// Ignore this error

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。