I want to save webpage in document directory with the images,css and javascripts etc..
I have done below code : But it only generates the html file..
NSURL *url = [NSURL URLWithString:@"http://www.apple.com"];
NSData *urlData = [NSData dataWithContentsOfURL:url];
[urlData writeToFile:filePath atomically:YES];
Any idea or suggestion is most welcome.
Thanks
The ASIHTTPRequest project has a class called
ASIWebPageRequestwhich is designed to do exactly what you want. If you’re okay with adding an additional dependency to your project then I think it’s a good solution for you: ASIWebPageRequest.On the page I liked above there are some good examples of how to use it but I’ll include one of them here for completeness: