2 yue1liang1chuan yue1liang1chuan 于 2013.01.30 14:47 提问

iphone-弹出一个view后再推出一个view

有一个在导航推的view,我在button中加了下面代码:

[self.navigationController popViewControllerAnimated:YES];
    FreeStuffViewController * freeStuffVC=[[FreeStuffViewController   alloc]initWithNibName:@"FreeStuffViewController" bundle:nil];
    [self.navigationController pushViewController:freeStuffVC animated:YES];
    [freeStuffVC release];

运行之后,只能弹出一个view,接下来推出的FreeStuffVc没出现,请帮忙解决,谢谢。

2个回答

abcdeFGh_xyz
abcdeFGh_xyz   2013.01.30 17:19
已采纳
    UINavigationController *local = [[UINavigationController alloc]init];
    [local popViewControllerAnimated:NO];
    newView *nr=[[newView alloc]init];
    [self.navigationController pushViewController:nr animated:YES];
love_loveec
love_loveec   2013.01.30 17:20
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;

看看这样行不

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!