我的应用程序使用 iTunes 文件共享。我使用代码删除了一个文件:它第一次工作。然而,在第二次尝试中,iTunes 显示了一个空的共享目录。原来所有的数据文件都不见了。我可以从 iPad 恢复这些数据文件吗?谢谢
- (void) deleteFileFromDisk: (NSString*) fileName {
if([self fileExists: fileName]) {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) ;
NSString *documentsDirectory = [paths objectAtIndex: 0];
NSString* theFile = [documentsDirectory stringByAppendingPathComponent: fileName];
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath: theFile error: &error];