Hello im constructing an iphone app the requires the user to switch tableviews depending on which button is selected at the top. I have five different tableviews each populated from an array in a plist file. My question is how do i tell this uitableview to switch to another array. Thanks!
Hello im constructing an iphone app the requires the user to switch tableviews depending
Share
You can have a dictionary or array of your arrays (the data) and a property/iVar for the “current” array. When they select a different option, you change the value of current array and call [tableView reloadData]; That will cause the table view call backs to trigger and reload all the data. All the table view callbacks should get their data from current array.
For example, let’s say we had three data sets, “cars”, “computers”, and “devices”.