运行此方法后,我尝试将其显示在视图上。由于某种原因,每次我尝试在此方法结束时使用以下内容时,它都不会显示:
[self viewWillAppear: YES];
我只是想将所有这些信息传递给 viewDidLoad 以便它显示。
-(void)categoryDining{
//Some method
[self viewWillAppear:YES];
};
编辑:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
MapViewController *category1 = [[MapViewController alloc] init];
NSArray *array=[self.navigationController viewControllers];
switch (indexPath.row) {
case 0:
[self.navigationController popToViewController:[array objectAtIndex:[array count]-2] animated:YES];
break;
case 1:
[category1 startOp];
[self.navigationController popToViewController:[array objectAtIndex:[array count]-2] animated:YES];
break;
// etc...
default:
break;
}
然后该方法在另一个视图控制器中运行:
-(void)startOp{
//Method here
[self viewWillAppear Animated:YES];
}
如您所见,我将消息发送到 viewWillAppear。它不会加载到屏幕上。