Skip to content

Instantly share code, notes, and snippets.

@ethanbing
Created March 28, 2014 10:35
Show Gist options
  • Save ethanbing/9829815 to your computer and use it in GitHub Desktop.
Save ethanbing/9829815 to your computer and use it in GitHub Desktop.
获取程序的Documents路径
/**
 Returns the path to the application's documents directory.
 */
- (NSString *)applicationDocumentsDirectory {
     
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
    return basePath;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment