view页面跳转
当一个View将要展现时触发该方法,可在该方法中准备将要展现到VIEW中的数据,比如重连数据库读取数据到NSMutableArray中然后通过[tableView reloadData]刷新tableView的显示内容!
View A 跳转方法
addStudentViewController *add; //View B
-(IBAction)addClicked:(id)sender{
add=[[addStudentViewController alloc]initWithNibName:@"addStudent" bundle:nil];
[self.view addSubview:add.view];
}
//View B 中的退出方法
-(IBAction)doneBtnClicked:(id)sender{
[self.view removeFromSuperview];
}
以下方法实现View跳转则触发!
-------------------------------------
View A 跳转方法
addStudentViewController *add; //View B
-(IBAction)addClicked:(id)sender{
add=[[addStudentViewController alloc]initWithNibName:@"addStudent" bundle:nil];
[self presentModalViewController:add animated:YES];
}
View B 中的退出方法
-(IBAction)doneBtnClicked:(id)sender{
[self.parentViewController dismissModalViewControllerAnimated:YES];
}

浙公网安备 33010602011771号