在一个项目中,我将 Three20 用于一些代码(不使用TTNavigator
或一些高级功能,只有几件事)。
当我尝试创建一个UIActionSheet
时,我得到一个EXC_BAD_ACCESS
错误。触发它的代码如下(在 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];
}
一旦我运行这段代码,我就会得到一个EXC_BAD_ACCESS
错误,并且堆栈指向调用的方法- (CGRect)frameWithKeyboardSubtracted:(CGFloat)plusHeight
在Three20's 里面UIViewAdditions.m
。
我注释掉了方法,然后得到了一个EXC_BAD_INSTRUCTION
代替,但这次是在方法中调用- (NSDictionary *)userInfoForKeyboardNotification
. 再次将其注释掉,现在在另一种方法中失败了UIViewAdditions.m
。
有没有人遇到过这个问题?我试过用 调试NSZombieEnabled
,但这不是原因(没有消息发送到僵尸对象)。