开发者

How to delete a row of plist programmatically?

开发者 https://www.devze.com 2023-02-18 13:17 出处:网络
Can anyone help me to delete row of plist. here dictValue is NSNumber, dict is NSDictionary, keys is NSMutableArray and mutDict is NSMutableDictionary.

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

精彩评论

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