1

NSHomeDirectory の特定のフォルダのディレクトリ リストをすばやく吐き出す方法はありますか? 次の方法で画像をダウンロードするASIHTTPRequestの例で遊んでいます。

[request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"totallyhotmilf.jpg"]];

Documents フォルダー内のファイルを一覧表示して、デバッグ目的で実際にダウンロードされるファイルを確認したいと思います。助けてくれてありがとう。

4

1 に答える 1

3

このページのおかげで、私の質問に対する答えが見つかりました。これにより、適切なファイル リストが表示されます。

// Create file manager
NSError *error;
NSFileManager *fileMgr = [NSFileManager defaultManager];

// Point to Document directory
NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];

// Write out the contents of home directory to console
NSLog(@"Documents directory: %@", [fileMgr contentsOfDirectoryAtPath:documentsDirectory error:&error]);
于 2010-11-03T16:10:53.913 に答える