uialertview

iphone UIAlertView Modal

大城市里の小女人 提交于 2019-11-28 11:07:06
Is it possible to present a UIAlertView and not continue executing the rest of the code in that method until the user responds to the alert? Thanks in advance. I guess stopping the code you meant was to stop the device to run the next code you have written after the alertview For that just remove your code after your alertview and put that code in the alertview delegate -(void) yourFunction { //Some code UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Your Message" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; [alert show]; [alert release]; //Remove

iPhone: detecting if a UIAlert/UIActionSheet are open

五迷三道 提交于 2019-11-28 11:06:57
In my iOS application, I have a timer firing up, and when it fires, I need to be able to detect whether there's an Alert (UIAlertView) or an Action Sheet (UIActionSheet) open. One way would be to modify the code presenting the alerts/actionsheets - but unfortunately this is not an option in my case. So, the question is - is there a way of knowing/detecting whether an alert or action sheet have been opened? Is there any notifications sent upon opening, or any traversal of the view hierarchy to detect it? Thanks Sam Ritchie They do send an alert when they open, but only to their delegate --

Highlight Top Button in UIAlertView

岁酱吖の 提交于 2019-11-28 10:16:54
I've got a UIAlertView with 3 buttons displayed vertically by default in the UIAlertView. I'd like the top button to be bold/highlighted. From my understanding and testing, the 'cancel' button is the one that is highlighted. The problem is no matter how I set the cancel button, it is placed last in this row. I cannot get it to be the first button. I've tried setting the cancel button explicitly UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:self cancelButtonTitle:@"Top Button" otherButtonTitles:@"Middle Button", @"Bottom Button", nil]; as well as setting

UIAlertView is Not Working in Swift

寵の児 提交于 2019-11-28 09:32:19
when i runt this code in swift, i dont know why the app terminates by showing a break point in the "alertView.show()" part, Somebody please help me. var alertView = UIAlertView( title: "Hey", message: "Hello", delegate: self, cancelButtonTitle: "Cancel" ) alertView.show() From Xcode 6.0 UIAlertView class: UIAlertView is deprecated. Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead. On swift ( iOS 8 and OS X 10.10 ), you can do this: var alert = UIAlertController(title: "Alert Title", message: "Alert Message", preferredStyle: UIAlertControllerStyle.Alert) alert

UIAlertView in iOS8 appearing off-center, mis-placed, only portion of the screen dimmed

人盡茶涼 提交于 2019-11-28 08:54:36
问题 I'm building an iPad app on iOS8, landscape, upgrading from iOS7. I've replaced UIAlertView (deprecated) with UIAlertController in a number of other places in my app which has fixed this issue. However, I also use a UIWebView which apparently shows its own UIAlertViews. When this happens I also get the same problem (see partial pic, cropped). The alert view is misplaced lower to the left and only the left 2/3 of the screen is dimmed, and worse, the right most portion that is not dimmed still

How to change button text color of UIAlertView in iOS7?

∥☆過路亽.° 提交于 2019-11-28 08:18:35
iOS7 introduced general tint-color. I think UIAlertView is also in the valid range, but actually tintColor doesn't look to work with UIAlertView . (for tappable button text color) Is it possible to change the tint-color of alert view? If possible, how to change it? null Unfortunately you cannot customize the appearance of alert views, it is impossible to change the buttons text color. It is mentioned clearly in UIAlertView Class Reference : The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

iOS4 (UIAlertView) why this code causes memory leaks?

最后都变了- 提交于 2019-11-28 06:54:14
问题 suppose you create a new iOS app from scratch, with just one single window. then you put this code in the appDelegate application didFinishLaunching method : UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"alert" message:@"message" delegate:nil /* same problem with 'delegate:self' */ cancelButtonTitle:nil otherButtonTitles:@"Ok", nil]; [myAlert show]; [myAlert release]; build and run in simulator 4.1, attach instrument, and... this causes each time a memory leak. in simulator 3.1

UIAlertView is crashing app on iOS 7

那年仲夏 提交于 2019-11-28 06:48:41
问题 I have just released my app on the App Store however I have just been emailed and told that there is issues with crashing. The issue is with Alert Views which crash my app when they are supposed to appear (only in iOS 7). I had some code in place that was supposed to fix this issue, however it doesn't seem to work in certain versions of iOS 7. Here is my current code: @IBAction func resetAllButton(sender : AnyObject) { //If statement to check whether the modern style alert is available. Prior

UIAlertController is moved to buggy position at top of screen when it calls `presentViewController:`

可紊 提交于 2019-11-28 05:44:56
Presenting a view from a UIAlertController moves the alert to a buggy position at the top-left corner of the screen. iOS 8.1, device and simulator. We have noticed this in an app when we attempt to present a view from the current "top-most" view. If a UIAlertController happens to be the top-most view we get this behavior. We have changed our code to simply ignore UIAlertControllers, but I'm posting this in case others hit the same issue (as I couldn't find anything). We have isolated this to a simple test project, full code at the bottom of this question. Implement viewDidAppear: on the View

iphone-sdk: Adding a textfield to UIAlertview does not work in iOS 4?

跟風遠走 提交于 2019-11-28 04:13:20
问题 I am trying to add uitextfield to my alterview . When the user tries to enter text the alterview is supposed to shift up a little bit so the keyboard does not overlap and when pressing the done key the keyboard is supposed to disappear and the alertview should shift back. It all works fine when run it in iOS 3.1.2 (and also in 3.2) but as soon as I try to run it under iOS 4 the alertview is displayed in the wrong position and the keyboard won't disappear. Any suggestions? Here is my code: -