English 中文(简体)
利用这些内容,我如何能够下载一个超文本文档,并超出现有文件(目标-c)?
原标题:Using theos, how can I download an HTML file and overwrite an existing one (objective-c)?

我试图简单地提出申请(在我装置上使用这些器具,这样就没有Xcode/mac, 即如果L,显示一个超文本文档,并在航标有一顿,通过从服务器下载新版本和翻写现有版本,更新当地超文本档案。My problem is that 较新版本的超文本没有下载,现有版本保持不变。

当纽伦受到压力时,这是我必须尝试和更新当地超文本档案的守则:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"blank" ofType:@"html"]isDirectory:NO]]];

NSData *theData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://mydomain.com/index.html"]];
[theData writeToFile:[NSBundle pathForResource:@"index" ofType:@"html" inDirectory:[[NSBundle mainBundle] bundlePath]] atomically:NO];

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];

空白.html是一个空白的超文本文档。 我在那里说,因此,我可以选择复读指数.html,而且有指数.html,没有用白色,而是用新版本书写。 我不敢肯定,如果发生这种情况,甚至是必要的,但那就没有工作了。 我认为,这样做可能固然存在。

更多信息:

<*RootViewController.h*>

@interface RootViewController: UIViewController {
    UINavigationBar*navBar;
    UIWebView*webView;
}
@property (nonatomic, retain) UIWebView*webView;
@end

以及

<*RootViewController.mm*>

#import "RootViewController.h";
@implementation RootViewController
- (void)loadView {
    //this is where I set up the webview, navigation bar, 以及 button
}

@synthesize webView;

- (void)theButtonPressed {
    //this is where I try to update the index.html file
}

Please let me know what I am doing wrong 以及 how to fix it or if you need any more information. Thanks!

最佳回答

只字不提,你再想写。

问题回答

暂无回答




相关问题
Navigate a WebView

With a webview is it possible to set up a simple Back button (either in a navigation bar or a top toolbar) that doesn t show the back button on the first URL of the WebView - and only appearing on a ...

How to display the Authentication Challenge in UIWebView?

I am trying to access a secure website through UIWebView. When I access it through safari, i get an authentication challenge but the same does not appear in my UIWebView in the application. How can I ...

UIWebView with links

I am creating a webview and loading content using "loadHTMLString" The content is loading I just can t get the links to work ex linking to google.com. Any help would be great. UIWebView* newWeb = [[...

Using multiple UIWebViews in a UIScrollView

I am using 5 UIWebViews in a UIScrollView to show the result of my game. Intention is to allow the user to scroll through the results screen. I had a problem where the UIWebViews won t load when ...

Image not displaying from local html on iPhone webview

I am calling an infoPage.html as below with an image from Resources and referenced as img src="eye.png" in the html, the text displays correctly but I cannot load the image (only a ? appears), any ...

Get Text UIWebView PHP script

Basically my app has a UIwebView which loads a php script with input of user data. The script then uses printf(some info). This all works and it prints it right the UIWebView. Basically what I want to ...

UIWebView shows error message

I am getting this error message in the console, while I am trying to load a HTML page in UIWebView? "void SendDelegateMessage(NSInvocation*): delegate failed to return after waiting 10 seconds. main ...

热门标签