任何人都可以帮我删除一行plist。
此处dictValue
为NSNumber
,dict
为NSDictionary
,keys
为NSMutableArray
,mutDict
为NSMutableDictionary
}。
if (editingStyle == UITableViewCellEditingStyleDelete) {
dictValue = [dict objectForKey:[keys objectAtIndex:indexPath.row]];
NSLog(@"Row Number - value %d", [dictValue intValue]);
mutDict = [[NSMutableDictionary alloc] initWithContentsOfFile:[self doccuments_Path]];
[mutDict removeObjectForKey:[keys objectAtIndex:indexPath.row]];
//[keys removeObjectAtIndex:indexPath.row];
[tableView reloadData];
// Delete the row from the data source.
//[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
非常感谢任何帮助:)
答案 0 :(得分:2)
尝试使用writeToFile: atomically:
方法