ipad – 什么原因错误NSNetServicesErrorCode =“ – 72000”?

ipad – 什么原因错误NSNetServicesErrorCode =“ – 72000”?,第1张

概述我创建了一个简单的浏览器,可以使用UIWebview加载本地文件.首先,当我尝试预览html文件时,uiwebview可以加载源文件并进行预览.但在我最小化应用程序(应用程序进入后台),然后再次打开应用程序后,我有这个错误: Error Dict: { NSNetServicesErrorCode = "-72000"; NSNetServicesErrorDomain = 10; 我创建了一个简单的浏览器,可以使用UIWebvIEw加载本地文件.首先,当我尝试预览HTML文件时,uiwebvIEw可以加载源文件并进行预览.但在我最小化应用程序(应用程序进入后台),然后再次打开应用程序后,我有这个错误:

Error Dict: {    NSNetServicesErrorCode = "-72000";    NSNetServicesErrorDomain = 10;}

之后,uiwebvIEw无法加载源文件,当我在(voID)webVIEw:(UIWebVIEw *)webVIEw dIDFailLoaDWithError:(NSError *)错误中记录错误时,它显示以下消息:

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标头内部,您将看到以下枚举解释每个错误:

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”?全部内容,希望文章能够帮你解决ipad – 什么原因错误NSNetServicesErrorCode =“ – 72000”?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1080953.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存