iphone app包中各个目录的访问

1. app包内资源的访问:

   NSString* docPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"doc"];

 

2.程序所在Home目录的访问(home目录有app包, Library目录, Documents目录和tmp目录):

 

  NSHomeDirectory()

 

3. 获取Documents目录路径:

  NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    NSString *documentsDirectory = [paths objectAtIndex:0];

 

或:#define kDocumentFolder [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"

 

你可能感兴趣的:(iPhone)