文件路径 封装常用代码

 

-(NSString *)filePath

{

    NSString *docPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDirectory, YES)objectAtIndex:0];

    NSString *path = [docPath stringByAppendingPathComponent:@"texts"];

 

 //  NSString *path = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches/texts"]; //两种方法都可以

    return path;

}

 
posted @ 2015-03-09 09:55  mengxiangtong22  阅读(193)  评论(0编辑  收藏  举报