アプリのドキュメントディレクトリから画像を削除したい。画像を削除するために私が書いたコードは:
 -(void)removeImage:(NSString *)fileName
{
    fileManager = [NSFileManager defaultManager];
    paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    documentsPath = [paths objectAtIndex:0];
    filePath = [documentsPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", fileName]];
    [fileManager removeItemAtPath:filePath error:NULL];
    UIAlertView *removeSuccessFulAlert=[[UIAlertView alloc]initWithTitle:@"Congratulation:" message:@"Successfully removed" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil];
    [removeSuccessFulAlert show];
}その部分的に働きます。このコードはディレクトリからファイルを削除しますが、ディレクトリ内のコンテンツを確認しているときは、そこにまだイメージ名が表示されています。そのファイルをディレクトリから完全に削除したい。同じことをするためにコードで何を変更すべきですか?ありがとう
contentsOfDirectoryAtPath(つまり、ここに含まれるディレクトリキャッシングはありません)。そのため、NSErrorコンテンツを見ると明らかになるような、プレイ中に簡単なエラーが発生する必要があります。