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
64
votes
7 answers

Unable to add UITextField to UIAlertView on iOS7...works in iOS 6

The code below works on iOS6 (and before) but the UITextField does not display in iOS7...any ideas on how to get a UITextField to display in an UIAlterView in iOS7? UIAlertView* dialog = [[UIAlertView alloc] init]; [dialog setDelegate:self]; [dialog…
iTrout
  • 1,454
  • 2
  • 12
  • 21
37
votes
5 answers

Several UIAlertViews for a delegate

Currently I've got a class popping up UIAlertViews here and there. Currently, the same class is the delegate for these (it's very logical that it would be). Unfortunately, these UIAlertViews will call the same delegate methods of the class. Now, the…
quano
  • 18,812
  • 25
  • 97
  • 108
10
votes
2 answers

Can you create anonymous inner classes in Swift?

I'm tired of declaring entire classes as having the ability to handle UIAlertView clicks by making them extend UIAlertViewDelegate. It starts to feel messy and wrong when I have multiple possible UIAlertViews, and have to distinguish which was…
7
votes
5 answers

How to add action to buttons in Alert in Swift

I am beginner level programmer. I am trying to add action to buttons on Alert, but it doesn't work. I just want to test if the alert button choice can change the text in label, but it doesn't work. Of course I can see the alert and buttons well, but…
user3806731
  • 889
  • 2
  • 8
  • 14
6
votes
3 answers

How can I perform the handler of a UIAlertAction?

I'm trying to write a helper class to allow our app to support both UIAlertAction and UIAlertView. However, when writing the alertView:clickedButtonAtIndex: method for the UIAlertViewDelegate, I came across this issue: I see no way to execute the…
Ky -
  • 30,724
  • 51
  • 192
  • 308
4
votes
3 answers

alertView:(UIAlertView *) alertView method not working in Appdelegate

I had set UIAlertView in AppDelegate.m file. But when I choose the button on the alert view. -(void) alertView:(UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex was not working. I had set UIAlertViewDelegate in the…
dickfala
  • 3,246
  • 3
  • 31
  • 52
2
votes
1 answer

Why is this UIAlertView's Position not changing?

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Blah" message:nil delegate:nil …
gran_profaci
  • 8,087
  • 15
  • 66
  • 99
2
votes
1 answer

iOS 7: UIAlertView created in UIActionSheet delegate function cannot auto rotate

The issue only can be reproduced in iOS 7. In the delegate function:- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex, if a UIAlertView is created, the alert view cannot auto rotate. Here is the sample…
2
votes
0 answers

Does a UIAlertView's Delegate have to be a view controller?

I've got an issue where an object that's creating a UIAlertView is sending a message back to its delegate, but the delegate object is crashing. I've got it working OK in a couple of other instances, but what I'm trying to do in this case (and what's…
Ben Carroll
  • 138
  • 2
  • 11
1
vote
0 answers

error: no type or protocol named 'UIAlertViewDelegate'

Using swift 2.0 Xcode 7.1. And I am going to use an essential 3rd party library which is written in Objective-C. Also it's using UIAlertViewDelegate and this error occurs when I am trying to import it from the bridging header file. Can you guys give…
Roger
  • 973
  • 10
  • 15
1
vote
3 answers

Why are all my UIAlertView labels/text bold by default in iOS 8

I searched for this and the only solutions seem to be derive from the UIAlertViewDelegate. I don't want to do that just to eliminate bold text. The code that I use to pop my alert view is the following: NSString* errPrompt = @"some text here,…
neuman8
  • 324
  • 4
  • 15
1
vote
4 answers

Pass information to UIAlertView delegate

I'm trying to delete a row in table view after confirmation from the user, using an alert view. However I don't know how to let the UIAlertViewDelegate method know which row in the table to delete. // Override to support editing the table view. -…
Mohammad Shaker
  • 185
  • 1
  • 15
1
vote
0 answers

Local Notification not linking up with NSDate String

My question is with this notification I have for my application. I am using a reminder notification for my music app, so people can get a notification two hours before I play a show. I tested this similar code earlier but with integer components…
Machina
  • 252
  • 2
  • 13
1
vote
1 answer

UIButton title refresh after UIAlertView

I have a button with title Fun whitch is set from the storyboard In viewDidLoad I change the title self.catBut.titleLabel.text = @"Random"; And then when another button is click UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title…
Ben
  • 1,906
  • 10
  • 31
  • 47
1
vote
0 answers

Hiding UIAlertView hides Botton UITabBar also

I stuck in a strange problem. My app is not a UITabBarController application, while I added a UITabBar to self.window. On appDelegate's didFinishLaunchingWithOptions I added UITabBar like this: UIWindow* window = [UIApplication…
Vaibhav Saran
  • 12,848
  • 3
  • 65
  • 75
1
2 3 4