how to use UISegmentedControl to change datasource in tableview
how to use UISegmentedControl to change datasource in tableview? with sql tables or read data from arrays 开发者_开发知识库 thanks
- Use
-addTarget:action:forControlEvents:
(with events UIControlEventValueChanged) to set up a response action for the segmented control. - In the action, check the sender's
selectedSegmentIndex
property. Use this to determine which data source to use. - Change the table view's
dataSource
property.
精彩评论