UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"tittle"
message:@""
delegate:self
cancelButtonTitle:@""
otherButtonTitles:nil];
[alertView show];
[alertView release];
i want to dimiss the alerview after it's showing for some time,but when the alertview has no button,it doesn't work if i invoked -dismissWithClickedButtonIndex:animated: method
and-performSelector:withObject:afterDelay:
is there any other way to dismiss it ?
thanks for any ideas!
-(void)xx {
[self performSelector:@selector(dismissAlertView:) withObject:alertView afterDelay:2];
}
-(void)dismissAlertView:(UIAlertView *)alertView{
[alertView dismissWithClickedButtonIndex:0 animated:YES];
}
that's it.i fix it