Ios remove(success,fail)调用success,但不';不要删除图像
我正在尝试删除phonegap(iOS)中的图像,因此我调用:Ios remove(success,fail)调用success,但不';不要删除图像,ios,xcode,cordova,Ios,Xcode,Cordova,我正在尝试删除phonegap(iOS)中的图像,因此我调用: window.resolveLocalFileSystemURI(imageURI, ok, no); 这将调用ok函数 function ok(entry) { alert("Deleting: " + entry.name); entry.remove(); } 所以一切都按计划进行,但我的形象仍然出现在我的图书馆里。我做错了什么 完整资料来源: window.
window.resolveLocalFileSystemURI(imageURI, ok, no);
这将调用ok函数
function ok(entry) {
alert("Deleting: " + entry.name);
entry.remove();
}
所以一切都按计划进行,但我的形象仍然出现在我的图书馆里。我做错了什么
完整资料来源:
window.resolveLocalFileSystemURI(imageURI, ok, no);
function ok(entry) {
alert("Delete file entry: " + entry.name);
entry.remove(pictureRemoved, notRemoved);
}
function pictureRemoved(){
alert('removed');
}
function notRemoved(){
alert('not Removed');
}
function no(error) { alert
("resolveFileSystemURI failed: " + error.code); }
请尝试以下代码:
//Delete file
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) {
fileSys.root.getFile(imageURI, {create: false},
function(file) {
file.remove(pictureRemoved, notRemoved);
}, no);
}, no);
它对我很有效。请尝试以下代码:
//Delete file
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSys) {
fileSys.root.getFile(imageURI, {create: false},
function(file) {
file.remove(pictureRemoved, notRemoved);
}, no);
}, no);
它对我很有用。添加文件插件。它会工作。添加文件插件。它会起作用的