作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我创建了一个简单的浏览器,可以使用 UIWebview 加载本地文件。首先,当我尝试预览 html 文件时,uiwebview 可以加载源文件并进行预览。但是在我最小化应用程序(应用程序进入后台),然后再次打开应用程序后,我收到了这个错误:
Error Dict: {
NSNetServicesErrorCode = "-72000";
NSNetServicesErrorDomain = 10;
}
(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
中记录错误时,它显示此消息:
Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo=0x53d610 {NSErrorFailingURLStringKey=http://localhost:9898/local/a.html?83C66B33-874C-41A7-BBF5-78D1615512DF, NSErrorFailingURLKey=http://localhost:9898/local/a.html?83C66B33-874C-41A7-BBF5-78D1615512DF, NSLocalizedDescription=Could not connect to the server., NSUnderlyingError=0x5ccaa0 "Could not connect to the server."}
最佳答案
如果您查看 NSNetServices
的内部 header ,您将看到解释每个错误的以下枚举:
typedef NS_ENUM(NSInteger, NSNetServicesError) {
/* An unknown error occured during resolution or publication.
*/
NSNetServicesUnknownError = -72000L,
/* An NSNetService with the same domain, type and name was already present when the publication request was made.
*/
NSNetServicesCollisionError = -72001L,
/* The NSNetService was not found when a resolution request was made.
*/
NSNetServicesNotFoundError = -72002L,
/* A publication or resolution request was sent to an NSNetService instance which was already published or a search request was made of an NSNetServiceBrowser instance which was already searching.
*/
NSNetServicesActivityInProgress = -72003L,
/* An required argument was not provided when initializing the NSNetService instance.
*/
NSNetServicesBadArgumentError = -72004L,
/* The operation being performed by the NSNetService or NSNetServiceBrowser instance was cancelled.
*/
NSNetServicesCancelledError = -72005L,
/* An invalid argument was provided when initializing the NSNetService instance or starting a search with an NSNetServiceBrowser instance.
*/
NSNetServicesInvalidError = -72006L,
/* Resolution of an NSNetService instance failed because the timeout was reached.
*/
NSNetServicesTimeoutError = -72007L,
};
关于ipad - 什么导致错误 NSNetServicesErrorCode = "-72000"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10550137/
Hiyee...现在当我尝试连接到域时遇到此错误“NSNetServicesErrorCode = -72003; NSNetServicesErrorDomain = 10; ”。 我的连接代码:
我创建了一个简单的浏览器,可以使用 UIWebview 加载本地文件。首先,当我尝试预览 html 文件时,uiwebview 可以加载源文件并进行预览。但是在我最小化应用程序(应用程序进入后台),然
我是一名优秀的程序员,十分优秀!