Board logo

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

作者: arnoldb1012    時間: 2010-7-15 03:09     標題: 獲取 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];




歡迎光臨 More Joy♪樂活天地 (http://sweethill.info/) Powered by Discuz! 7.0.0