TBN
TBN

Reputation: 21

File placement for iPhone Applications

If your application accesses and edits an already existing file is it okay for that file just to be placed in the resources folder?

Upvotes: 2

Views: 76

Answers (1)

Ole Begemann
Ole Begemann

Reputation: 135548

No, because the app bundle is read-only on the iPhone. You would have to copy the file from the bundle to your app's documents directory on first launch. Use this code to find the documents directory:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];

Upvotes: 3

Related Questions