UIAlertView 自动dismiss? (先设NSTimer,后调用Delegate)

- (void) performDismiss: (NSTimer *)timer

{
    [baseAlert dismissWithClickedButtonIndex:0 animated:NO];//important
    [baseAlert release];
    baseAlert = NULL;
}
 
- (void) presentSheet
{
    baseAlert = [[UIAlertView alloc]
                              initWithTitle:@"Alert" message:@"\nMessage to user with asynchronous information"
                              delegate:self cancelButtonTitle:nil
                              otherButtonTitles: nil];
    [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector: @selector(performDismiss:)
                                   userInfo:nil repeats:NO];
    [baseAlert show];
}
原文地址:https://www.cnblogs.com/easonoutlook/p/2642807.html