iOS7中的UIAlertview不会被解雇

时间:2014-06-25 06:07:27

标签: ios objective-c ios7 uialertview uialertviewdelegate

iOS7中的

UIAlertview在子类中被解雇但在父类中被解雇时不会被解雇。有什么解决方案吗?

UIAlertView  *alertView=[[[UIAlertView alloc]initWithTitle:@"" 
                                                   message:@"Please Select the Start Date"
                                                  delegate:self
                                         cancelButtonTitle:@"Ok"
                                                   otherButtonTitles:nil] autorelease];
[alertView show];

委托方法:

#pragma UIAlertView Delegate
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (buttonIndex==0) {
        [alertView dismissWithClickedButtonIndex:0 animated:YES];
    }
}

0 个答案:

没有答案