objective c - How to save a locally loaded HTML file in UIWebview -


i writing rich text editor using uiwebview. this, used template file starter.

then when user finishes editing has not published yet, save current content back-up html file in case app corrupts.

how do that?

here go... buddy

    nsfilehandle *file;     nsmutabledata *data;      const char *bytestring = "black dog";//in case html string here      data = [nsmutabledata datawithbytes:bytestring length:strlen(bytestring)];     nsstring *path = //path html file      if ([filemgr fileexistsatpath:path] == yes){     nslog (@"file exists"); file = [nsfilehandle filehandleforupdatingatpath:path];          if (file == nil)                 nslog(@"failed open file");          [file writedata: data];          [file closefile]; }       else     nslog (@"file not found"); 

complete tutorial below

working file i/o in objective-c


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -