c开发者_如何学运维urrently I'm developing a program that have 2layer of table, which the value will be take from JSON,
I've done almost all, but the navigation part hinder me, the program will have a list of data in the 1st view, then when user click (let say) option 1, it'll switch view to the next table with some option A,B,C,etc.
But so far, when I click the option 1, it never switch view.
Although the data inside the table data source are those of the 2nd table.
Oh, I use the push method to switch the view.
RootViewController *rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:rvController animated:NO];
I try to use [self.tableview reloadData], to reload the tableview(hoping to have the correct value shown in the table), it never shown.
Any help is appreciated.
Thanx in advance.
give an iboutlet uitableview *somename to tableview.And change the array which you are passing according to your requirement.And then using the tableview name you can reload it.
Finally I found the solution from a book. I'll share my finding here, hopefully it'll help those who stuck with the same problem as me.
DemoAppDelegate *delegate =[[UIApplication sharedApplication] delegate];
[delegate.navigationController pushViewController:rvController animated:YES];
It works like a charm to me, hopefully it'll help u guys.
精彩评论