0

when clicked button "ok" alert automatically closes, How to prevent it

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

i want clicked button "OK" and not dismiss alert ..if(logics){ not dismis } else { dismiss alert }

thanx

niskatqq
  • 65
  • 1
  • 8
  • Try something like https://github.com/regexident/DLAlertView which allows you to use delegates or blocks to respond to behavior. – JaredH Dec 15 '14 at 22:03
  • What are you trying to accomplish? – Marcus Adams Dec 15 '14 at 22:12
  • The solution in the duplicate linked post subclasses `UIAlertView`. Bear in mind that `UIAlertView` is now deprecated in iOS 8 and replaced by `UIAlertController`. – Robotic Cat Dec 15 '14 at 22:39

1 Answers1

0

You'll need to create your own UI component if you want that behavior. UIAlertView is designed to display some basic information and give you some number of button options that once clicked, close the alert view.

Acey
  • 8,048
  • 4
  • 30
  • 46