iOS Path

1 Documents 存放應用數據文件,iTunes可以備份。

2Library 應用相關文件。可以使用NSUserDefaults類訪問的應用設置文件。

3 tmp:臨時文件

4iOS和UNIX類似,文件名稱都是大小寫敏感

   

	//獲取主目錄
	NSString *homePath = NSHomeDirectory();
	NSString *tmpPath =NSTemporaryDirectory();
		//Document目錄。
	NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *document= [paths objectAtIndex:0];
		//它下面的路徑testpath
	NSString *filePath = [document stringByAppendingPathComponent:@"testpath"];
	


發佈了74 篇原創文章 · 獲贊 1 · 訪問量 8萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章