我想将文件保存到文件夹,然后检索该文件夹的所有内容,所以我这样做:
NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:storageFolder];
// StorageFolder is just a string like: "@"/FavoritesFolder"
// Filename is just a title given like "myTune.mp3"
NSString *destinationString = [NSString stringWithFormat:@"%@/%@",dataPath,filename];
BOOL success = [object writeToFile:destinationString atomically:YES];
然后我想检索对象,所以我这样做
NSArray *dirContents = [[NSFileManager defaultManager]contentsOfDirectoryAtPath:dataPath error:nil];
但我得到的只是一个数组filename
(比如 myTune.mp3)。不是Object
哪个是 NSDictionary。我究竟做错了什么?