我無法顯示目錄中的所有文件。我確實在所有應用程序文件的相同文件夾中創建了一個名爲「保存」的目錄。contentsOfDirectoryAtPath返回null(iOS)
我用這個代碼:
NSError *error = nil;
NSArray *imageFiles = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"saves" error: &error];
NSLog(@"FILES: %@", imageFiles);
誰能幫助我,因爲這段代碼記錄「空」 - 所以假裝沒有在文件夾中任何東西,但該文件夾中我做了一個目錄,兩個空文件。
檢查錯誤消息,並張貼。 添加NSLog(@「%@」,error.localizedDescription) – damithH 2013-09-13 10:02:18