应用程序目录的路径 目录下是应用程序的沙盒
NSString* path = [NSHomeDirectory() stringByAppendingPathComponent:@"Test.db"];
官方文档:
Returns the path to either the user’s or application’s home directory, depending on the platform.
NSString * NSHomeDirectory (void);
Return Value
The path to the current home directory..
Discussion
In iOS, the home directory is the application’s sandbox directory. In OS X, it is the application’s sandbox directory or the current user’s home directory (if the application is not in a sandbox)
For more information on file-system utilities, see Low-Level File Management Programming Topics.
Availability
Available in iOS 2.0 and later.
See Also
NSFullUserName
NSUserName
NSHomeDirectoryForUser
Declared InNSPathUtilities.h