简体   繁体   中英

Error when using UIActionSheet and Three20

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).

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... 替代文字

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM