Commit 85b971e4 authored by admin's avatar admin

修复 删除后的图片再次进来后还会出现

parent f66ec6f5
......@@ -358,6 +358,15 @@
- (void)deletePicture:(UIButton *)button
{
NSLog(@"从imageName中删除了第%ld张图片",(button.tag - 5521));
NSString *imageName = [self.imageNameArray objectAtIndex:(button.tag - 5521)];
NSString *path0 = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",_taskModel.uuid]];
NSString *paths = [path0 stringByAppendingPathComponent:imageName];
if ([[NSFileManager defaultManager] fileExistsAtPath:paths]) {
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:paths error:&error];
}
// 从存放所有Image的数组里移除当前点击的Image
[self.imageNameArray removeObjectAtIndex:(button.tag - 5521)];
......@@ -370,6 +379,10 @@
[button removeFromSuperview];
button = nil;
[self removeDeleteButton];
}
- (void)removeDeleteButton {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment