如何以编程方式删除一行plist?

时间:2011-03-17 12:18:34

标签: iphone

任何人都可以帮我删除一行plist。

此处dictValueNSNumberdictNSDictionarykeysNSMutableArraymutDictNSMutableDictionary }。

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];
    }   

非常感谢任何帮助:)

1 个答案:

答案 0 :(得分:2)

尝试使用writeToFile: atomically:方法