Board logo

標題: 獲取 iPhone程序的文檔目錄的方法 [打印本頁]

作者: charlesoger0808    時間: 2011-2-10 17:33     標題: 獲取 iPhone程序的文檔目錄的方法

iPhone程序的文檔目錄通常用於儲存用戶數據,下面介紹2種獲取 iPhone程序的文檔目錄的方法,轉自 iphone-geek.cn


方法一:
1
2
NSString* documentsDirectory  = [NSHomeDirectory()
        stringByAppendingPathComponent"Documents"];




方法二:

1
2
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];




歡迎光臨 ♂AD-man♂男人世界 (http://compassshop.info/) Powered by Discuz! 7.0.0