[iPhone]获取document目录路径

1477阅读 0评论2011-01-17 xwhbin
分类:C/C++

  1. NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  2.     NSString *documentDirectory = [paths objectAtIndex:0];
  3.     NSString *filename = [documentDirectory stringByAppendingPathComponent:@"textFile.txt"];
  4.     NSLog(@"filename = %@", filename);
  5.     NSLog(@"documentDirectory = %@", documentDirectory);
  6.     
  7.     
  8.     NSString *tempPath = NSTemporaryDirectory();
  9.     NSString *tempFile = [tempPath stringByAppendingPathComponent:@"tempFile.txt"];
  10.     
  11.     NSLog(@"tempPath = %@", tempPath);
  12.     NSLog(@"tempFile = %@", tempFile);
上一篇:收集的UITextField常用控件
下一篇:切换 32位 or 64位 内核 – Mac OS X 10.6