【问题标题】:Delete the storage file in iOS删除 iOS 中的存储文件
【发布时间】:2016-10-01 09:14:30
【问题描述】:

无法在 iOS 中删除存储文件。以下在 android 中有效,但 img 每次在 iOS 中都会显示。

FileSystemStorage.getInstance().deleteRetry(FileSystemStorage.getInstance().getAppHomePath() + "profile.png", 1);

我尝试了以下方法,但它们也不能在模拟器中工作

Storage.getInstance().deleteStorageFile(FileSystemStorage.getInstance().getAppHomePath() + "profile.png");

Storage.getInstance().deleteStorageFile("profile.png");

文件存储如下:

URLImage.createToStorage(placeholderForProfile, "profile.png",au.profileImgUrl + getUserProfileImg, ada);

【问题讨论】:

    标签: codenameone


    【解决方案1】:

    FileSystemStorageStorage 是您将它们混合在一起的两个独立概念。

    Storage 仅适用于固定名称(不适用于层次结构、路径等),FileSystemStorage 仅适用于完整路径。

    这是删除存储文件时的正确做法:

    Storage.getInstance().deleteStorageFile("profile.png");
    

    如果这对您不起作用,请确保您之前关闭了存储文件并且您没有使用它。还要确保您正确地将其创建为“配置文件”并且没有使用路径。

    【讨论】:

      猜你喜欢
      • 2020-11-26
      • 1970-01-01
      • 2021-07-07
      • 2017-02-01
      • 1970-01-01
      • 2021-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多