Easy function to get the path to the documents directory for data persistance

/ Published in: iPhone
Save to your folder(s)

Here is a simple function that will return the path to the documents directory so you can store data in it later

Copy this code and paste it in your HTML
  1. - (NSString *)documentsDirectory
  2. {
  3. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  4. NSString *documentsDirectory = [paths objectAtIndex:0];
  5. return documentsDirectory;
  6. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.