2013-11-28 30 views

回答

0

1)在使用此代碼按「做點按鈕」,可以做一些動作,但不會導致alertView隱藏

UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Title" message:@"The message." delegate:self cancelButtonTitle:nil otherButtonTitles: @"Do something", nil] show]; 

#pragma mark - UIAlertViewDelegate 

- (BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView { 
    return NO; 
} 

2)如果使用這種代碼將不會有在alertView按鈕(我想這是你真正需要

UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Title" message:@"The message." delegate:self cancelButtonTitle:nil otherButtonTitles:nil] show];