Showing posts with label Document Directory iOS iPhone iPad Apple. Show all posts
Showing posts with label Document Directory iOS iPhone iPad Apple. Show all posts

Sunday, March 25, 2012

Documents Directory

Simple C function to retrive the path of the documents directory in iOS

NSString *documentsDirectory(void)
{
 static NSString *docPath = nil;
 if(docPath == nil)
 {
  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  docPath = [[paths objectAtIndex:0] retain];
 }
    return docPath;
}