简体   繁体   中英

How to call EditTable method of UITableView from some other class?

I want to edit UITableView by calling EditTable method on a button click of some other class. In other words, I want to delete rows from UITableview from some other viewcontroller without navigating to that UITableView.

Please tell me the way to achieve this or any sample code for it.

If you want to delete rows from a tableview you just need to delete the corresponding rows from the datasource. When the table is next shown it should know how to reload it's data so the changes in the datasource are applied to the table.

Edit

You shouldn't rely on sending messages to view controllers that are deeper in the stack because they may have been unloaded already.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM