gpt4 book ai didi

ios - ipad 应用程序奇怪的行为

转载 作者:行者123 更新时间:2023-11-29 11:05:14 25 4
gpt4 key购买 nike

我的 ipad 项目是基于主从 View 的。详细 View 的工具栏上有一个按钮,当用户点击该按钮时,它会弹出一个弹出 View 以显示四个按钮(作为菜单)。其中三个按钮的 Action 如下(三个按钮显示三种不同的模型表单):

- (void) showOnlineSgf
{
NSLog(@"showOnlineSgf");
TGOOnlineSgfViewController *dlg =
[[TGOOnlineSgfViewController alloc] initWithNibName:@"TGOOnlineSgfViewController"
bundle:nil];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:dlg];

[nav setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentViewController:nav animated:YES completion:nil];
dlg = nil;
nav = nil;
}

另一个按钮的操作是显示 MFMailComposeViewController。代码如下:

- (void) emailCurrentGame
{
NSLog(@"email current game");
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[self presentModalViewController:picker animated:YES];
picker = nil;
}

奇怪的是,当我点击按钮时,应该执行 showOnlineSgf(),但实际上执行了 emailCurrentGame()。当我在 showOnlineSgf() 中设置断点时,它被命中,并逐步执行 showOnlineSgf() 中的每个语句。但屏幕上的结果是出现了 MFMainComposeViewController。

我知道这个问题很难回答。任何想法表示赞赏。

最佳答案

检查触发 showOnlineSgfUIButton 的 socket 连接。您很可能在 Interface Builder 中复制粘贴了 UIButton,这会导致它也复制其分配的操作。然后您连接了其他操作,导致您的 UIButton 具有两个操作。

要解决此问题,只需将触发 showOnlineSgfUIButtonemailCurrentGame 操作断开连接即可。

关于ios - ipad 应用程序奇怪的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13953979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com