iPhone使用TabBar视图中的模态视图

时间:2021-09-15 19:39:54

Using a Modal View from a TabBar View

使用TabBar视图中的模态视图

I always get the following error: Error from Debugger: Previous Frame identical to this frame (gdb could not unwind past this frame)

我总是收到以下错误:来自调试器的错误:上一帧与此帧相同(gdb无法解开此帧)

I have an App using a TabBar. From one of the TabViews I need to display a View modally. I try:

我有一个使用TabBar的应用程序。从其中一个TabView我需要以模态方式显示View。我尝试:

if(self.gmailController == nil) {

    self.gmailController =
        [[GMailViewController alloc] initWithNibName:@"GMailView" bundle:nil];
}

[[self.navigationController] 
        presentModalViewController:gmailController animated:YES];

////////

And I have tried:

 [self.parentViewController 
        presentModalViewController:gmailController animated:YES];

    and 

 [self.tabBarController presentModalViewController:gmailController animated:YES];

    and 

 [self presentModalViewController:gmailController animated:YES];

 Thanks for reading! Any comments welcome.

 Mark

2 个解决方案

#1


Check all the connections in your NIB files. I was getting this same error after I changed the name of an IBOutlet variable but forgot to adjust the NIB. This broke the connection between the ViewController and the NIB.

检查NIB文件中的所有连接。我更改了IBOutlet变量的名称但忘记调整NIB后,我得到了同样的错误。这打破了ViewController和NIB之间的连接。

#2


I am sorry. This problem involved my error. I had a problem with the nib file loading. Once I fixed the NIB, the Modal View loaded with:

对不起。这个问题涉及我的错误。我有一个nib文件加载的问题。一旦我修复了NIB,Modal View加载了:

[self.tabBarController presentModalViewController:gmailController animated:YES];

[self.tabBarController presentModalViewController:gmailController animated:YES];

#1


Check all the connections in your NIB files. I was getting this same error after I changed the name of an IBOutlet variable but forgot to adjust the NIB. This broke the connection between the ViewController and the NIB.

检查NIB文件中的所有连接。我更改了IBOutlet变量的名称但忘记调整NIB后,我得到了同样的错误。这打破了ViewController和NIB之间的连接。

#2


I am sorry. This problem involved my error. I had a problem with the nib file loading. Once I fixed the NIB, the Modal View loaded with:

对不起。这个问题涉及我的错误。我有一个nib文件加载的问题。一旦我修复了NIB,Modal View加载了:

[self.tabBarController presentModalViewController:gmailController animated:YES];

[self.tabBarController presentModalViewController:gmailController animated:YES];