iphone - Create and store HTML file in ios -


i want create html file in ios programmatically. how should create html file , store in document directory?

this way create file in document directory

  nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentdirectory = [paths objectatindex:0]; nsstring *filepath = [nsstring stringwithformat:@"%@/%@", documentdirectory,@"index.html"];   nsdata *data=[@"<html><body>hai</body></html>" datausingencoding:nsutf8stringencoding]; [data writetofile:filepath atomically:yes]; 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -