All articles on this site are
X1135768777Original, reprinted must be explicitly noted:
Address: http://blog.csdn.net/x1135768777/article/details/7623237
On iPhone and iPad, folder resouces is read-only and cannot be written. The document and temp folders can be read and written.
Recently I am working on a project. It is possible to write plist on the simulator, but not on the real machine. The last time we met was that the layout of the uitextview simulator was very different from that of the real machine. After all, the simulator was just a simulator!
Not much nonsense
Just change the storage path, for example, put it under the document:
Nsstring * markname = @ "Book 1, page 5th"; // Add the Book Number and page number nsarray * Doc = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes ); nsstring * docpath = [Doc objectatindex: 0]; nsstring * doclocation = [docpath stringbyappendingpathcomponent: @ "bookmark. plist "]; nsmutablearray * markarray = [[nsmutablearray alloc] usage: doclocation]; [markarray addobject: markname]; nslog (@" % @ ", markarray); [markarray writetofile: doclocation atomically: Yes];
I will not explain it at a glance.