objective c - How to access files in interior of an iPhone App? -


i need in iphone app access files app build with(.plist etc). there's hardcoded way this:

nsstring *appdir = [[[nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes)                       objectatindex:0]                       stringbydeletinglastpathcomponent]                     stringbyappendingpathcomponent:appfolder]; 

where appfolder name of folder app, "test.app". after appdir known, access files simple.

is there other, not-hardcoded way have access files form app?

thanks in advance!

 nsstring* pathtofile =      [[[nsbundle mainbundle] resourcepath]           stringbyappendingpathcomponent:@"myfile.plist"];  // or, better (handling localization): nsstring* pathtofile = [[nsbundle mainbundle] pathforresource:@"myfile"                                                        oftype:@"plist"]; 

Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -