【发布时间】:2009-09-11 07:55:38
【问题描述】:
场景:
1. 显示基于导航控制器的视图
2.用户选择选项
3. 显示模态视图 A
4.用户在模态视图A中选择另一个选项
5. 隐藏模态视图 A
6. 显示模态视图 B
// This function must show modal view A
This scenario implemented like this:
- (IBAction)showModalViewA:(id)sender {
ModalViewA *viewA = [[ModalViewA alloc] forParent:self];
[self presentModalViewController:viewA animated:YES];
[viewA release];
}
// This function must hide modal view A and show modal view B
- (void)didSelectOptionInViewA {
ModalViewB *viewB = [[ModalViewB alloc] init];
viewB.peoplePickerDelegate = self;
[self dismissModalViewControllerAnimated:NO]; // Problem Is Here
[self presentModalViewController:viewB animated:YES];
[viewB release];
}
请查看标记为 // 问题出现的行
当我设置 dismissModalViewControllerAnimated:NO 它工作正常。
如果此参数为 YES,则 viewB 不会出现在屏幕上。
如何让它与动画一起使用?
【问题讨论】:
标签: iphone objective-c cocoa-touch xcode model-view-controller