Questions tagged [uialertviewdelegate]

The `UIAlertViewDelegate` protocol defines the methods a delegate of a `UIAlertView` object should implement. The delegate implements the button actions and any other custom behavior. Some of the methods defined in this protocol are optional.

The UIAlertViewDelegate protocol defines the methods a delegate of a UIAlertView object should implement. The delegate implements the button actions and any other custom behavior. Some of the methods defined in this protocol are optional. On UIAlertViewDelegate, you can find the following methods:

Responding to Actions

  • alertView:clickedButtonAtIndex:

Customizing Behavior

  • alertViewShouldEnableFirstOtherButton:
  • willPresentAlertView:
  • didPresentAlertView:
  • alertView:willDismissWithButtonIndex:
  • alertView:didDismissWithButtonIndex:

Canceling

  • alertViewCancel:
60 questions
1
vote
1 answer

UIAlertView button is disabled even after picking date from UIDatePicker

The problem is that after picking date from UIDatePicker the "Ok" button of UIAlertView is disabled.I tried ,but no luck. -(BOOL)alertViewShouldEnableFirstOtherButton:(UIAlertView *)alertView should be called whenever we type anything in…
Nilesh Kumar
  • 2,141
  • 3
  • 16
  • 20
1
vote
3 answers

UIAlertView crashes when button tapped: how to solve?

I have a class that I instance to show an alert view like this: - (void)showAlert { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Do you want to try again?" …
AppsDev
  • 12,319
  • 23
  • 93
  • 186
1
vote
4 answers

Which button on my UIAlertView did the user press?

I've created a UIAlertView and now I want to check which button the user presses. My code is: - (IBAction)button1 { { UIAlertView *alert1 = [[UIAlertView alloc] init]; [alert1 setTitle:@"Hello"]; [alert1 setMessage:@"Do…
1
vote
1 answer

Custom UIAlertView, Message Change on delegate

On my client project I need to create a UIAlertView on a button press. That part is not hard and have done it with said code: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { …
Keeano
  • 309
  • 8
  • 33
0
votes
2 answers

UIAlertView not fading even after the response action is taken

In my UIAlertView, I want to open another UIView when "OK" button is pressed. But the problem is, even after the UIView is displayed, alert remains in screen and once it fades away, the UIView seems to be disabled. UIAlertView *alert =…
user1065969
  • 589
  • 4
  • 10
  • 19
0
votes
2 answers

Object gets dealloc'd before UIAlertView Delegate gets called

I have two view controllers on a Navigation stack. In the first view controller, I have a method that shows an alert to go to a website and navigate away from the app. If they click NO, nothing happens, if YES, then it opens the link. This all…
J W
  • 868
  • 1
  • 12
  • 25
0
votes
2 answers

clickedButtonAtIndex method is not called

when the user click on a button on the UIAlertView the clickedButtonAtIndex method is supposed to be called, however, it doesn't : in the .h i have called the UIAlertView protocol : @interface RechercherViewController :…
Malloc
  • 15,434
  • 34
  • 105
  • 192
0
votes
1 answer

How to show an alert when turn off bluetooth in Swift app?

The question could be duplicated, but I have tried a lot of code and it wasn't work. I have read about CBCentralManagerOptionShowPowerAlertKey option and the possibility to show an alert to go settings bluetooth option into iPhone for turn on on…
user3745888
  • 6,143
  • 15
  • 48
  • 97
0
votes
1 answer

The Alert View shows many time not one time

I create UIAlertView in my function, the problem is it shows a lot of time when the function runs, how can I create an if statement to show only one time like if UIAlertView shows not show any more. - (void)showAlert { _myAlertView = nil; …
0
votes
0 answers

Show response without loading UIAlertView again on same UIAlertView while taking user input swift 3

I am using UIAlertView to get user input. I want to add validation on user entered value. When a user enters the invalid value I want to show the response on same UIAlertView by changing alert message only without loading UIAlertView again. I don't…
0
votes
1 answer

UIAlertViewDelegate method clickedButtonAtIndex not getting called when implementing my own delegate

I'd like to popup an alert from different ViewControllers. Because I wanted to handle whether the user clicked "OK" or "Cancel" consistently, I decided to implement my own UIAlertViewDelegate and call it from my UIViewController. The problem is that…
Mel
  • 959
  • 5
  • 19
0
votes
1 answer

viewWillAppear UIAlertView not showing

I have two different view controllers, one for a dashboard and one for registration. I do not want the user to be able to interact with anything on the dashboard until the user logs in through an alertview. So every time the user navigates back to…
Cbas
  • 6,003
  • 11
  • 56
  • 87
0
votes
1 answer

UIAlertView Delegate Protocol in iOS

I am a beginner in iOS development, and yesterday I learned about the UIAlertViewDelegate protocol from the Apple developer website. I used -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex for managing the…
user3891540
0
votes
1 answer

Customization default UIAlertView

I want to change default UIAlertView background color for view (gray) to red. How can I do it?
0
votes
2 answers

Validating UITextField and Display an UIAlertView if error

I would like to validate UITextField and display an UIAlertView if there is an error. Previously I used the code below. It works perfectly with 2 UITexfields but with many UITextfield it's not possible. Any tips how to display an UIAlertView to…