3

I am trying to store an image in the device through my program. I am able to store the image in the sandbox. After quitting the app when I run it again the address of the sandbox changes so I am not able to retrieve it and use it in the next run.
Please help.

RAS
  • 7,807
  • 15
  • 61
  • 81
SocialCircus
  • 2,002
  • 6
  • 24
  • 34

1 Answers1

4

Have a look at this stackoverflow question.

To get a path to the apps own document path you do

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

For a complete description of how to use the filesystem on the iPhone see the documentation here

Files in iPhone OS share space with the user’s media and personal files on the flash-based memory. For security purposes, your application is placed in its own directory and is limited to reading and writing files in that directory only. The following sections describe the structure of an application’s local file system and several techniques for reading and writing files.

Community
  • 1
  • 1
epatel
  • 44,965
  • 17
  • 105
  • 143