Posted By

codeRefiner on 11/30/11


Tagged

data and loading iphone saving


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

codeRefiner
bug5


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


 / Published in: iPhone
 

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

  1. - (NSString *)documentsDirectory
  2. {
  3. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  4. NSString *documentsDirectory = [paths objectAtIndex:0];
  5. return documentsDirectory;
  6. }

Report this snippet  

You need to login to post a comment.