Tableview deleting row and getting proper index

Hi,

in my Tableview I have a button in each row that deletes the row in question and a button outside of the tableview that deletes the last row of the tableview.

When I delete a row with the ‘in row’ button and then proceed to delete rows with the ‘out row’ button I get returned the error 'warning row (x) doesn’t exist) where x is the row I deleted with the in-row button.

I think it’s the indexing system not working properly… Is there a call or command to make the tableview ‘aware’ of the right number of rows and their index at any time (without re-rendering)

Thank you a lot…