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
Post a Comment