Hey there,
I'm building an app that allows a user to select or take a photo then it is saved as a jpeg to the app's documents directory. Everything works perfectly, however, I realized that each time I build and run the Xcode project on the device, in reinstalls the app thus creating a new documents directory path. Is there any way to retain the path each time the app is installed?
This is the code I'm using to generate the path to the document's directory for saving:
NSArray *thePathArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *finalPath = [[thePathArray objectAtIndex:0] stringByAppendingPathComponent:@"user_image.jpg"];
Is there a better way to do this? Can I use a relative path? Or is there no real solution since the entire app is reinstalled each time it's build via Xcode?
Thanks, Howie