2010-09-15 269 views
1

在一个项目中,我对某些代码使用了Three20(不使用TTNavigator或某些高级功能,只有几件事情)。使用UIActionSheet和Three时出现错误

当我尝试创建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

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

回答

0

我通过检查每个Three20项目的“Build Active Architectures Only”复选框来解决这个问题。这似乎是几个Three20相关错误的神奇设置... alt text