uialertview

UIAlertView Dynamically in iPhone App

南笙酒味 提交于 2019-12-04 21:25:39
I want to display dynamic UIAlertView and Indicator within it when data is loading from web-service. Also I don't want any button on UIAlertView. And it will be stopped automatically when data will be loaded successfully. How can I implement it.? If you are using WebView then write startAnimating ActivityIndicator in ViewDidLoad and this delegate method will call by itself when your data will be loaded - (void)webViewDidFinishLoad:(UIWebView *)webView { //[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO]; [ActivityIndicator stopAnimating]; } Hope it helps.Thanks :) Just

how to color specific words in a uialertview or UIAlertController ? (SWIFT)

假如想象 提交于 2019-12-04 21:01:33
is there a way to color some specific words in uialertview ? I mean, can I color the word RED as red and at the same time GREEN as green ? Can someone bring me on the right way? You could make use of NSAttributedString and UIAlertController : let strings = [["text" : "My String red\n", "color" : UIColor.redColor()], ["text" : "My string green", "color" : UIColor.greenColor()]]; var attributedString = NSMutableAttributedString() for configDict in strings { if let color = configDict["color"] as? UIColor, text = configDict["text"] as? String { attributedString.appendAttributedString

How to show alert once after installing the app in ios device

懵懂的女人 提交于 2019-12-04 19:14:52
How to show an alert only once at the start of an application after installing the application on device or on simulator until I delete it from my device. Is it possible tell me.. Nikita P You can do it this way: if (![[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"]) { //first launch //show your alert [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"]; [[NSUserDefaults standardUserDefaults] synchronize]; } else { // app already launched } 来源: https://stackoverflow.com/questions/14495747/how-to-show-alert-once-after-installing-the-app-in-ios

Attempting to Modify Object Outside of Write Transaction

拈花ヽ惹草 提交于 2019-12-04 19:05:25
问题 So I have no idea why I am getting this error. The error message is as follows: * Terminating app due to uncaught exception 'RLMException', reason: 'Attempting to modify object outside of a write transaction - call beginWriteTransaction on a RLMRealm instance first.' * First throw call stack: (0x2f7b0f83 0x39f61ccf 0xc46ef 0xc3c23 0xc0c9d 0xb3e73 0x3a449833 0x3a449ded 0x3a44a297 0x3a45c88d 0x3a45cb21 0x3a58bbd3 0x3a58ba98) libc++abi.dylib: terminating with uncaught exception of type

Check if Google Maps App is installed in iOS 6

懵懂的女人 提交于 2019-12-04 18:15:05
问题 I am trying to figure out how to handle the result of this code to see if Google Maps is installed in the app. [[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"comgooglemaps://"]]; I am creating a UIAlertView with the option in there and if it is or isn't I wish to give the user different options. How do I take the result of the code above and turn it into a BOOLEAN? Thanks in advance. 回答1: The result is already of canOpenURL: a boolean: BOOL canHandle = [[UIApplication

UIAlertView with a user supplied context and [self autorelease]

こ雲淡風輕ζ 提交于 2019-12-04 17:59:19
I have looked over some ideas for how to supply a context to a UIAlertView. The common answers are save it in a dictionary or subclass UIAlertView. I don't like the idea of saving the context in a dictionary, it's the wrong place for the data. Subclassing UIAlertView is not supported by Apple, so by my standard, is not a good solution. I came up with an idea, but I'm not sure what to make of it. Create an instance of a context object that is the delegate of UIAlertView. The alert view context, in turn, has it's own delegate which is the view controller. The trouble is releasing memory. I set

UIAlertViewDelegate and more Alert windows

时光怂恿深爱的人放手 提交于 2019-12-04 17:48:22
问题 I have controller which implements UIAlertViewDelegate. In implementation I have: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex method. When I create UIAlertView I put for 'delegate' to 'self' and it works fine. But problem is that now I have one more alert views and I want different behaviors for each of them. So how to check which alertView send message? 回答1: UIAlertView is a UIView subsclass and so has tag property you can use to differentiate

Can't use Control Center when UIAlertView displayed (iOS 7)

守給你的承諾、 提交于 2019-12-04 17:14:57
So i set up a retry connection when reachability detects no connection. I want the user to be able to use the Control Center to re-enable WiFi while the UIAlertView is presented. Anyway I can do this? Picture Of What Control Center Looks Like Picture Of A UIAlertView 来源: https://stackoverflow.com/questions/20225928/cant-use-control-center-when-uialertview-displayed-ios-7

Swift: Insert Alert Box with Text Input (and Store Text Input )

こ雲淡風輕ζ 提交于 2019-12-04 17:04:08
问题 In one of my viewController , I want to make an alert box appear that prompts the user to type this information.Then, I want the user to store this input using NSUserDefaults . How can I achieve this? Thank you in advance! 回答1: Check this out: let alertController = UIAlertController(title: "Email?", message: "Please input your email:", preferredStyle: .alert) let confirmAction = UIAlertAction(title: "Confirm", style: .default) { (_) in guard let textFields = alertController.textFields,

UI issue with nil title in UIAlertView iOS 8 beta 5

一个人想着一个人 提交于 2019-12-04 16:48:56
问题 I have an issue related to UIAlertView while running our app on iOS 8. I am showing an alert with title as nil. It was working fine in iOS 7 but now UI looks odd. I have attached screenshot here. One solution I found is that when I provide empty string @“” it looks okay. See below screenshot. But I am not sure if the issue I mentioned is bug in beta iOS 8 version or if there is any other better solution. Even with the solution it's not exact as it was in iOS 7. iOS 7 - showing alert view with