objective c - Finding path to plist in Xcode project folder -


i have plist in xcode project's resource folder on physical drive it's in top folder of project. want read , write same file. using nsbundle reads , gives no problem. i'm using code read file path:

nsstring *thepath = [[nsbundle mainbundle]  pathforresource:@"myfile" oftype:@"plist"]; 

but think nsbundle doesn't allow writing , didn't work when tried write file. using following code creates/ updates file using application path

nsarray *patharray = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdirectory, yes); nsstring * docsdirectory = [patharray objectatindex:0]; nsstring *filepath = [docsdirectory stringbyappendingpathcomponent:@"myfile.plist"]; 

but now, need write on internal file. solution access it? besides, i've tried giving path working directory project directory. doesn't work.

it's not nsbundle doesn't support writing, it's ios itself. ios not let app write own bundle.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -