NSURLErrorDomain错误

编程入门 行业动态 更新时间:2024-10-27 08:33:46
本文介绍了NSURLErrorDomain错误-999-iOS中的链接失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个运行内部HTML页面的iOS应用,这些页面全部来自HTML主菜单

I have an iOS app running a bunch of internal HTML pages all coming out from a HTML main menu

我正在使用Hype来构建页面.

I'm using Hype to construct the pages.

菜单不可靠,有时可以识别鼠标单击,有时不能识别

The menu is not reliable, sometimes mouse clicks are recognised, sometimes not

成功并加载页面后-子页面加载时,我的xcode输出控制台会向我显示以下消息

When successful and the page loads - My xcode output console is giving me the following message when the sub page loads

无法加载网页,并显示以下错误:无法执行该操作 完全的. (NSURLErrorDomain错误-999.)

Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)

每个页面具有2个iFrame(一个用于附加内容,一个用于音频播放器)

The pages in question each feature 2 iFrames ( one for additional content, 1 for an audio player)

取出iFrame可以治愈它,但它们是该应用程序的核心

Taking out the iFrames cures it but they are kinda core to the App

我一直在检查,发现有些人建议插入此

I've been checking around and have seen that some folk suggest inserting this

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

进入我的项目,但作为使用xcode的菜鸟,我不确定将其放置在何处

into my project but as a noob with xcode, I'm unsure of where to place it

非常感谢-感谢

推荐答案

通常在MainViewController.m中

Normally in MainViewController.m

- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error { NSLog(@"Error %i", error.code); if (error.code == NSURLErrorCancelled) { return; // this is Error -999 } return [super webView:theWebView didFailLoadWithError:error]; }

更多推荐

NSURLErrorDomain错误

本文发布于:2023-11-26 05:41:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1632855.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   NSURLErrorDomain

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!