ビューには、この構造がありますvista1 UIView-> tabla1 UITableView-> tabla1_controller UITableViewController vista2 UIView-> tabla2 UITableView-> tabla2_controller UITableViewController
I use views because depending of the orientation I move around the views.
Everything works fine, each tableviewcontroller gets data from sqlite and show the custom cells.
I want to add a behavior, when the user selects a cell in the second table, I want to change the content of the first table.
The first tableView gets information from a NSArray, how do I change
So how can I make this happen?
これは2番目のtableviewcontrollerです
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
/* I dunno how to reference the nsarray of the first table here */
first_table_array = ....
[tabla1 reloadData];
}
この場合は2つのtableviewcontrollerを使用しますが、実際の手がかりは、1つのviewcontrollerから別のtableviewcontrollerの関数を実行したり変数を変更したりするにはどうすればよいですか?
たとえば、tabla2_controller(UITableViewController)で、ユーザーがtable2の行をクリックしたときに、両方のテーブルがそれぞれ独自のビューにあり、両方のビューが同時に表示されている場合、どうすれば[tabla1_controllerreload]を実行できますか?