【发布时间】:2014-03-03 22:12:11
【问题描述】:
我遇到了一个仅定期引发错误的问题。事实上,它似乎几乎是随机的。这就是发生的事情,我正在使用以下代码启动一个模态视图控制器:
- (void)createMessageClicked
{
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Channel" bundle:nil];
UINavigationController *nav = [sb instantiateViewControllerWithIdentifier:@"HIComposeMessageNavController"];
HIComposeMessageViewController *vc = [[nav viewControllers]objectAtIndex:0];
vc.channel = [self.channels objectAtIndex:0];
[self.navigationController presentViewController:nav animated:YES completion:nil];
}
大多数时候,这工作正常。但是有时应用程序会崩溃并引发错误"Application tried to present modally an active controller <UINavigationController>。有什么想法我在这里做错了吗?
【问题讨论】:
标签: ios iphone objective-c uistoryboard