【发布时间】:2014-05-22 08:17:20
【问题描述】:
我正在使用导航控制器:
所以,从我的第一个视图到我通过推送视图控制器进入第二个视图
并形成第二个视图,通过当前模型视图控制器进入第三个视图
现在我的问题是,在第三个视图上,我想通过推送视图控制器进入第四个视图,但是当我尝试推送第四个视图时没有任何反应,我现在该怎么办?
我正在使用此代码
在我的 delegate.h 文件中,我创建了一个导航控制器的属性:
@property (strong, nonatomic) UINavigationController *navigationControler;
@property (strong, nonatomic) ViewController *loginViewController;
在我的 delegate.m 文件中:
self.loginViewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.navigationControler = [[UINavigationController alloc] initWithRootViewController:self.loginViewController];
self.window.rootViewController = self.navigationControler;
[self.window makeKeyAndVisible];
当我像这样通过预设模型视图控制器进入第三个视图时:
Redeem *redeem = [[Redeem alloc] init];
[self presentViewController:redeem animated:YES completion:nil];
在到达第二个视图后,我想用这样的推送视图进入第三个视图
[self dismissViewControllerAnimated:YES completion:^(void){
MyPurchaseCards *mypurchase = [[MyPurchaseCards alloc] init];
[self.navigationController presentViewController:mypurchase animated:YES completion:nil];
}];
但什么也没有发生,当我尝试像这样获取所有以前的控制器时也没有发生任何事情
NSArray *arr = self.navigationController.viewControllers;
NSLog(@"%@",arr);
但数组显示空值。为什么??????
【问题讨论】:
标签: objective-c model-view-controller navigationcontroller