使用 UIActionSheet 和 Three20 时出错
在一个项目中,我将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通过检查 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...