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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -