Search code examples
htmliosnsfilemanagernsdocumentdirectory

How to save html files in Document Directory iOS?


I have lots of html files and i want to save that html files into an Temporary Directory or an Documents Directory which one is suitable. I want to save all the html files in the directory Please tell me how to do that. Thanks.


Solution

  • copy all html files in your project root folder . then these files can be accessed from nsbundle main bundle.

    NSURL *rtfUrl = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@".html"];

    then enter image description here

    if you want to download all html files to document folder. then you want to access them you can take help from this question