Re: [問題] 有了地址但不知道怎麼轉成TableView

看板MacDev作者 (鹽です)時間14年前 (2011/03/19 16:49), 編輯推噓0(002)
留言2則, 1人參與, 最新討論串3/3 (看更多)
※ 引述《zonble (zonble)》之銘言: : ※ 引述《man27382210 (鹽です)》之銘言: : : 如題... : : 我日前用 : : NSArray *paths = : : NSSearchPathForDirectoriesInDomains : : (NSDocumentDirectory, NSUserDomainMask, YES); : : NSString*documentDirectory = [paths objectAtIndex:0]; : : 取得到Documents的資料夾路徑 : : 但不是很清楚要怎麼把這裡面的東西列在TableView上 : NSFileManager -enumeratorAtPath: : 簡單來說 : NSDirectoryEnumerator *e = [[NSFileManager defaultManager] -enumeratorAtPath:documentDirectory]; : NSString *filename = nil; : while (filename = [e nextObject]) { : // filename 就是檔名,看你想怎麼顯示 : } 我最後是用這個方法 NSString *paths = [NSHomeDirectory() stringByAppendingPathComponent: @"Documents"]; fileList = [[[[NSFileManager defaultManager] contentsOfDirectoryAtPath:paths error:nil] pathsMatchingExtensions:[NSArray arrayWithObjects: @"txt", @"jpg", nil]] retain]; 不過老實說我是查書的 我不是很懂第二句那串長長的式子意義到底是什麼 @"txt",@"jpg"那邊倒是不用說了@@ 請教版上的高手有沒有比較適合解讀的寫法 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.45.184.101

03/19 18:06, , 1F
順便追問 Dropbox的api有沒有說明文件阿@@?
03/19 18:06, 1F

03/19 18:07, , 2F
一大串的東西不知道從何看起@@
03/19 18:07, 2F
文章代碼(AID): #1DX6uBPK (MacDev)
文章代碼(AID): #1DX6uBPK (MacDev)