开发者

iphone--how to use checkmark to filter the information?

开发者 https://www.devze.com 2023-02-01 02:36 出处:网络
I know how to add checkmark into the tableview, but the question is how to use checkmark to filter the information? That means if i have checked item-1开发者_StackOverflow, in the table view or view j

I know how to add checkmark into the tableview, but the question is how to use checkmark to filter the information? That means if i have checked item-1开发者_StackOverflow, in the table view or view just display the related information about item-1. Anyone can help me or tell me some related tutorial~ Thanks


Here's one approach:

  • Register an action for your checkmark (not sure how you've implemented it but if it's, say, a UIButton, use the addTarget method)

  • In the method that gets called when you click the checkmark, modify the data source so that it's filtered to what you want to display

  • Call [self.tableView reloadData] to have the UITableViewController reload its tableView object

Hope this helps!

0

精彩评论

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

关注公众号