I am developing an app in which I have to delete the contacts from table ,problem is that when i delete one contact ,I have switch from one view to another then I can see the changing b/c i put the reload method in viewAppear any suggestion?
Share
In general you should avoid to use
reloadDatato refresh the content of a UITableView, you should only do it if you can’t avoid it (ie you replace everything in your table) or the user won’t see it (ie in viewWillAppear).I would suggest to use
insertRowsAtIndexPaths:withRowAnimation:to insert single rows anddeleteRowsAtIndexPaths:withRowAnimation:to remove rows.So you get the indexPath of the row when you delete a contact and call
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:deletedIndexPath] withRowAnimation:UITableViewRowAnimationFade]Those details make the difference between a app and a good app.