ios - Read a .txt file inside documents directory -


how can read .txt file inside documents directory? can show me code?

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *filepath = [documentsdirectory stringbyappendingpathcomponent:@"txtfile.txt"]; nsstring *content = [nsstring stringwithcontentsoffile:filepath encoding:nsutf8stringencoding error:null]; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -