开发者

How to delete a row of plist programmatically?

Can anyone help me to delete row of plist.

here dictValue is NSNumber, dict is NSDictionary, keys is NSMutableArray and mutDict is 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];
    }   

Any help would be extremely appreciated :)


try to use writeToFile: atomically:method

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜