使用 UIActionSheet 和 Three20 时出错

发布于 2024-09-19 18:18:07 字数 1227 浏览 6 评论 0原文

在一个项目中,我将 Three20 用于某些代码(不使用 TTNavigator 或一些高级功能,仅使用一些功能)。

当我尝试创建 UIActionSheet 时,收到 EXC_BAD_ACCESS 错误。触发它的代码如下(在 UIViewController 上)

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Is Anyone Injured?"
                                                             delegate:self
                                                    cancelButtonTitle:nil
                                               destructiveButtonTitle:nil
                                                    otherButtonTitles:nil];
    [actionSheet addButtonWithTitle:@"Cancel"];
    [actionSheet showInView:self.view];
}

一旦运行此代码,我就会收到 EXC_BAD_ACCESS 错误,并且堆栈指向名为 < code>- (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight

在 Three20 的 UIViewAdditions.m 内。

我注释掉了该方法,然后得到了一个 EXC_BAD_INSTRUCTION ,但这次是在名为 - (NSDictionary *)userInfoForKeyboardNotification 的方法中。再次将其注释掉,现在在 UIViewAdditions.m 的另一个方法中失败了。

有人遇到过这个问题吗?我尝试使用 NSZombieEnabled 进行调试,但这不是原因(没有消息发送到僵尸对象)。

In a project I'm using Three20 for some of the code (not using the TTNavigator or some advanced features, only a few things).

When I try to create an UIActionSheet, I get an EXC_BAD_ACCESS error. The code that triggers it is as follows (on a UIViewController)

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];

    UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Is Anyone Injured?"
                                                             delegate:self
                                                    cancelButtonTitle:nil
                                               destructiveButtonTitle:nil
                                                    otherButtonTitles:nil];
    [actionSheet addButtonWithTitle:@"Cancel"];
    [actionSheet showInView:self.view];
}

As soon as I run this code, I get an EXC_BAD_ACCESS error, and the stack points to the method called - (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight

inside Three20's UIViewAdditions.m.

I commented out the method, and then got an EXC_BAD_INSTRUCTION instead, but this time in the method called - (NSDictionary *)userInfoForKeyboardNotification. Again, commented that out, and now failed in another method of UIViewAdditions.m.

Did anyone run into this issue? I've tried debugging with NSZombieEnabled, but it was not the cause (no messages were sent to zombie objects).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

紫瑟鸿黎 2024-09-26 18:18:07

我通过检查 Three20 项目中每个项目的“仅构建活动架构”复选框来解决问题。对于几个与 Three20 相关的错误来说,这似乎是一个神奇的设置......
替代文本

I solved by checking on each of the Three20 projects the "Build Active Architectures Only" checkbox. It seems to be a magical setting for several Three20 related errors...
alt text

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文