有一个在导航推的view,我在button中加了下面代码:
[self.navigationController popViewControllerAnimated:YES];
FreeStuffViewController * freeStuffVC=[[FreeStuffViewController alloc]initWithNibName:@"FreeStuffViewController" bundle:nil];
[self.navigationController pushViewController:freeStuffVC animated:YES];
[freeStuffVC release];
运行之后,只能弹出一个view,接下来推出的FreeStuffVc没出现,请帮忙解决,谢谢。
UINavigationController *local = [[UINavigationController alloc]init];
[local popViewControllerAnimated:NO];
newView *nr=[[newView alloc]init];
[self.navigationController pushViewController:nr animated:YES];
FreeStuffViewController * freeStuffVC=[[FreeStuffViewController alloc] initWithNibName:@"FreeStuffViewController" bundle:nil];
[self.navigationController pushViewController:freeStuffVC animated:YES];
NSMutableArray *viewArray = [[self.navigationController viewControllers] mutableCopy];
[viewArray removeObjectAtIndex:viewArray.count - 2];
self.navigationController.viewControllers = viewArray;
看看这样行不