uialertview

How do you pass a variable to the UIAlertView delegate?

↘锁芯ラ 提交于 2019-11-30 03:01:45
How do you pass a variable to the UIAlertView delegate? I have a variable that I want to use in the alert view delegate. It is only used in the function that shows the UIAlertView and the UIAlertView delegate, so i don't think it should be a property on the controller. Is there a way to attach the variable to UIAlertView and retrieve it in the delegate? - (void) someUserCondition:(SOCode *)userCode { if ([userCode warrentsConfirmation] > 0) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Are you sure?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@

iOS 8: UIAlertView / UIAlertController not showing text or buttons

心已入冬 提交于 2019-11-30 02:12:40
问题 I have an UIAlertView which is getting shown perfectly in iOS 7 but in iOS 8, it does not show any buttons or labels. Alert is still visible but just a small white box. The OK and cancel buttons take their events as well but no texts are visible. I have used this alert to show on click of a button - (IBAction)sel_btnLogout:(id)sender { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Logout!" message:@"Are you sure you want to logout?" delegate:self cancelButtonTitle:@"Cancel"

Make UIAlertView Button trigger function On Press

倾然丶 夕夏残阳落幕 提交于 2019-11-30 01:25:54
Currently I am using the following code to present a UIAlertView: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Today's Entry Complete" message:@"Press OK to submit your data!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; [alert release]; How do I get it so that when 'OK" is pressed, it triggers a function, say -(void)submitData Vijay-Apple-Dev.blogspot.com NOTE: Important: UIAlertView is deprecated in iOS 8. (Note that UIAlertViewDelegate is also deprecated.) To create and manage alerts in iOS 8 and later, instead use UIAlertController with a

'UIAlertView' was deprecated in iOS 9.0. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead

无人久伴 提交于 2019-11-30 01:23:39
I have see more so answers , but nothing helped.Here is my older alert and action for that override func viewWillAppear(animated: Bool) { if Reachability.isConnectedToNetwork() == true { print("internet connection ok") } else { print("internet not ok") let alertView: UIAlertView = UIAlertView(title: "Alert ", message: "connect to internet", delegate: self, cancelButtonTitle: "settings", otherButtonTitles: "cancel") alertView.show() return } } func alertView(alertView: UIAlertView, clickedButtonAtIndex buttonIndex: Int) { if buttonIndex == 0 { //This will open ios devices wifi settings

how i can implement a custom UIAlertview with a progress bar and a cancel button?

牧云@^-^@ 提交于 2019-11-30 00:13:50
问题 Hi iPhone application developers, I am developing an iphone application. This application allows a user to upload images to my server. I want to show the upload progress in an alertView. I need some example code to illustrate how to implement a custom UIAlertView with a progress bar. Thanks in advance. 回答1: The "fast" way to do this is to take a UIAlertView and reposition its internal subviews to shove your progress bar into it. The downside of that is it is fragile and is likely to break in

Swift 4 Attempt to present ViewController whose view is not in the window hierarchy

蹲街弑〆低调 提交于 2019-11-29 23:18:52
问题 I am using swift 4 and I am trying to create an alertView when I there is an error while signing up a user using Firebase . I have an IBAction for the sign up button which will sign the user up using text from two textfields , one for email and one for password. I am basically trying to show an alertview when there is an error with the sign up process, for example there is an empty textfield . I have attached a screenshot of the function to where that is occuring. I know that I am in fact

Customize UIAlertController in iOS 8 to include standard elements like UITableView

不羁的心 提交于 2019-11-29 22:24:21
I am used to customize UIAlertViews through the [ alert setValue:someView forKey:@"accessoryView"] method. This creates customizable content for UIAlertViews with custom heights. However it only works on iOS7 and down. In iOS8 the UIAlertController have taken over, and I cannot customize it anymore, it will cut the height of the UIAlertView . Is it impossible because of misuse of the UIAlertController , or how am I supposed to do it? I am trying to incorporate a UITableView inside a UIAlertController with UIAlertControllerStyleAlert . Thx. I ran into the same issue right now. I looked at the

How to create an alert box in iphone?

被刻印的时光 ゝ 提交于 2019-11-29 22:15:21
I would like to make an alert type box so that when the user tries to delete something, it says, "are you sure" and then has a yes or no for if they are sure. What would be the best way to do this in iphone? A UIAlertView is the best way to do that. It will animate into the middle of the screen, dim the background, and force the user to address it, before returning to the normal functions of your app. You can create a UIAlertView like this: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Wait" message:@"Are you sure you want to delete this. This action cannot be undone" delegate:self

want to display UIProgressView on UIAlertView

試著忘記壹切 提交于 2019-11-29 22:05:19
问题 Hi guys i want to display UIProgressView on UIAlertView for displaying the processing of uploading of the file but i have searched too much and also find on that link but sill unable to do that. I don't get idea from this If anyone know the easiest way to do that then please let me know. I'll be thankful. 回答1: Try this code... UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; UIProgressView *pv = [[UIProgressView

View on top of everything: UIWindow subview VS UIViewController subview

瘦欲@ 提交于 2019-11-29 21:32:25
In order to make a UIView on top of all views like the behavior of UIAlertView , the best way I see is by putting it in the app window, which is by adding the view to: [[[UIApplication sharedApplication] delegate] window] However, the downside I found is that it doesn't automatically take in rotation. In order for it to take in rotation, the best way to do is by adding the view on current AppDelegate window.navigationController / rootViewController , however, by doing this it will no longer be on top of everything. Let say when view is displaying and there is a modalViewController popup, the