我有一个HomeViewController
作为rootViewController。我在addButton
中放置了barButtonItem
。如果我点击addButton
它会显示NewConnectionViewController。< / p>
HomeViewController.m
- (IBAction)onClickAddConnection:(id)sender
{
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
NewConnectionViewController * nvc = (NewConnectionViewController *)[sb instantiateViewControllerWithIdentifier:@"newConnectionIdentifier"];
[self.navigationController pushViewController:nvc animated:YES];
}
在NewConnectionViewController
我放置了一个connectionNoText
。如果connectionNoText
等于435.它应该显示连接详细信息的值(值在{{1}的对象中在connect
中。}我必须使用HomeViewController
中的ChartView显示连接详细信息值。我有一个名为HomeViewController
的单独UIView
类。
NewConnectionViewController.m
chartView
单击“保存”按钮时,我可以调用-(IBAction)Save:(id)sender
{
if ([stateText.text isEqualToString:@"Tamilnadu"])
{
if ([connectionNoText.text isEqualToString:@"435"])
{
NSLog(@"ConnectionNo correct==>>%@",connect);
HomeViewController *homeViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"HomeViewidentifier"];
[self.navigationController pushViewController:homeViewController animated:YES];
}
}
}
。但如果我在homeViewController中单击chartView
并且我写了435并且我单击了保存按钮意味着它应该显示ChartView的值为Down第一个视图......。每当我们点击保存按钮时,它应该添加chartView ..如果你对此段落感到困惑,没有什么只是“喜欢用ChartView添加值来在HomeViewController中呈现它,还必须使用tableView逐个添加“
答案 0 :(得分:0)
你需要将rootviecontroller作为navigationcontroller来推送一个viewcontroller,否则self.navigationcontroller不存在引用