繁体   English   中英

无法从Dropbox删除文件(来自iPhone应用程序)

[英]Cannot delete files from Dropbox(from iPhone app)

我正在尝试从我的Dropbox中删除文件。 我已经实现了滑动删除行为。 此'swipe-delete'仅从tableView中删除文件。 下次上传时,我可以看到“已删除”的文件,当我在PC上查看我的Dropbox帐户时,这些文件永远不会被删除。 文件从tableView中消失后,它们甚至会立即存在。

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView   editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath  {    
      return UITableViewCellEditingStyleDelete;
  }

- (void)tableView:(UITableView *)aTableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath :(NSIndexPath *)indexPath  {                
    [self.itemArray  removeObjectAtIndex:indexPath.row];        

    [aTableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];

    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0]withRowAnimation:UITableViewRowAnimationFade];     
} 

您的代码只显示您正在从表格视图中删除该条目。 没有实际从文件系统中删除的代码,例如。 通过使用

[[NSFileManager defaultManager] removeItemAtPath:filepath error:&error];

上面的讨论(NSFileManager)仅从设备中删除文件。 要删除dropbox上的文件,我们必须使用deleteFilePath和deletePathFailedWithError。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM