I don’t know is question is well-formed. So i have an uialertview shown at start application for 30 seconds. In this uialertview there is a button “ok” on which user can click and release alert. if users don’t click this button for 30 seconds the alert will release.
Here is code..
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome"
message:@"Welcome!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert setDelegate:self];
[alert show];
dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC*30.0);
dispatch_after(delay, dispatch_get_main_queue(), ^{
[alert release];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
}
So i have to implement the control with a boolean to check if users clicks ok or not…
can u help me? i’m new in objective c 🙂 thanks!
Show your alert view as follows:
Assume isD is BOOL value (declare it as class member in .h file)
And write the UIAlertViewDelegate method