當我這樣做時,我得到了解決方案。
-(void)deleteClicked:(id)sender
{
UITableViewCell *clickedCell = (UITableViewCell *)[[sender superview] superview];
clickedButtonPath = [self.tableView indexPathForCell:clickedCell];
NSArray *arrayDelete = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryD = [arrayDelete objectAtIndex:0];
NSDictionary *dictOfplist1 = [contentArray objectAtIndex:clickedButtonPath.row];
//To remove the videos from Documents folder
NSString *pathTemp1 = [documentsDirectoryD stringByAppendingString:[dictOfplist1 objectForKey:@"fileVideoE"]];
BOOL succeed1 = [[NSFileManager defaultManager] removeItemAtPath:pathTemp1 error:nil];
//To remove the images shown in cell from Documents folder.
NSString *pathTemp2 = [documentsDirectoryD stringByAppendingString:[dictOfplist1 objectForKey:@"fileImageE"]];
BOOL succeed2 = [[NSFileManager defaultManager] removeItemAtPath:pathTemp2 error:nil];
//To remove the data from the plist which is in Documents folder.
NSString *pathDelete = [documentsDirectoryD stringByAppendingString:@"/details.plist"];
[contentArray removeObjectAtIndex:[clickedButtonPath row]];
[contentArray writeToFile:pathDelete atomically: YES];
//To reload the data of the plist after deleting the items from it.
[self.tableView reloadData];
}
每一件事情是罰款該單元被刪除,在plist中的數據被刪除的文檔文件夾中的視頻和圖像將被刪除。
這是當我刪除第二行時的圖像。
謝謝。
alt text http://www.freeimagehosting.net/uploads/f3c96ae3a7.png