[英]Error when using UIActionSheet and 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
错误,并且堆栈指向名为- (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight
在Three20的UIViewAdditions.m
。
我注释掉了该方法,然后得到了EXC_BAD_INSTRUCTION
,但是这次是在名为- (NSDictionary *)userInfoForKeyboardNotification
。 再次将其注释掉,现在在另一种UIViewAdditions.m
方法中UIViewAdditions.m
。
有没有人遇到这个问题? 我尝试使用NSZombieEnabled
调试,但这不是原因(没有消息发送到僵尸对象)。
我通过在Three20项目中选中“仅构建活动架构”复选框来解决。 对于几个与Three20相关的错误,这似乎是一个神奇的设置...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.