uialertview

How to customize UIAlertView? Will Apple approve it?

纵饮孤独 提交于 2019-12-04 08:41:19
问题 I am using a custom UIAlertView with UITextField to get password from the user. I have been told that this custom view may cause my App to get reject by Apple; is that correct? If so, what is the appropriate replacement for my custom control? 回答1: You can add a textfield to your UIAlertView UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"msg" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:nil]; UITextField *txtField = [[UITextField alloc]

How do I make a UIAlertView appear only once, at the first start-up of an iPhone app?

青春壹個敷衍的年華 提交于 2019-12-04 07:50:36
I'm using the UIAlertView to make a pop-up happen once the app has started up. It works fine but I only want the pop up to appear on the first start-up of the app. At the moment I've got the UIAlertView in the AppDelegate class, in applicationDidFinishLaunching method. Here is my code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { sleep(4); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome!" message:@"SAMPLE!!!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; I'm new to

iphone alertview with textfield

感情迁移 提交于 2019-12-04 07:49:07
I have an UIAlertView with a UITextField in it. I want to type the mail id and submit in UIAlertView 's ok button, but UITextField in the UIAlertView have no response, Please help me. thankz xcoder From iOS 5 the approach above is no longer necessary. Just set the alertViewStyle property to the appropriate style ( UIAlertViewStyleSecureTextInput , UIAlertViewStylePlainTextInput , or UIAlertViewStyleLoginAndPasswordInput ). Example: UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Email" message:@"Enter your email:" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok",

Multiple UIAlertViews in the same view

只愿长相守 提交于 2019-12-04 07:03:44
I have two UIAlertViews with ok/cancel buttons. I catch the user response by: - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex The question I'm having is, which alertView is currently open? I have different actions to do when clicking ok/cancel on each one... You have several options: Use ivars. When creating the alert view: myFirstAlertView = [[UIAlertView alloc] initWith...]; [myFirstAlertView show]; // similarly for the other alert view(s). And in the delegate method: - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger

Fetching JSON data after failed retrieval

安稳与你 提交于 2019-12-04 06:58:58
问题 In my application, I am fetching JSON data. Occasionally, the application will fail to fetch it and when I print the responseObject, it returns ( ). I would like to make an if statement so that when this happens, a UIAlertView will show up. Right now, I have an if statement saying that if self.jobs == nil, the alert will come up, but that is not working. I'd really appreciate any help! - (void)viewDidLoad { [super viewDidLoad]; //Fetch JSON NSString *urlAsString = [NSString stringWithFormat:@

How to rotate UIAlertController in Swift

故事扮演 提交于 2019-12-04 05:47:42
I have a working UIAlertController , but I want to rotate the alert.view by 90 degrees left. How can I do it? My code is here below: let alert = UIAlertController(title: "", message: "Message Sample", preferredStyle: .Alert) alert.addAction(UIAlertAction(title: "Okay", style: .Default){(action)->() in }) presentViewController(alert, animated: true) {} I tried to add: alert.view.transform = CGAffineTransformMakeRotation(CGFloat(M_PI_2)) but it doesn't work. Thank you ! With this code: let alert = UIAlertController(title: "", message: "Message Sample", preferredStyle: .Alert) alert.addAction

How to send in-app announcements to people using my iOS app?

限于喜欢 提交于 2019-12-04 05:27:40
问题 I have a couple apps on the Apple App Store and would like some way to send announcements to users whenever I want. Basically, I want to remotely change the text of an IUAlertview and only trigger it to appear if I want it to (upon app opening and only if I updated the message). So far I have no problem making the IUAlertview appear on when the app opens, and I can easily program an NSUserDefault flag to only make the IUAlertview appear under certain circumstances, but really have no idea how

How does [UIAlertView show] work?

倖福魔咒の 提交于 2019-12-04 02:25:40
I want to do something similar to UIAlertView, ie - without reference to any UIView or UIViewController, present a UIViewController on top of all windows using presentModalViewController. Looking at the documentation I can't find a way in which this is possible! In OS4, there is something like this: UIWindow *window = [UIApplication sharedApplication].keyWindow UIViewController *rootViewController = window.rootViewController ...but this is not possible in OS3. Does anyone know how to achieve the same effect in OS3? Thanks! OK - so I solved this with a myriad of delegate callbacks to the

tony million Reachability says unreachable when connected

戏子无情 提交于 2019-12-04 02:03:35
I have searched but have not found an issue like mine. I'm sure it's something I have over looked . I am using tony million's reachability block method. it is working good when i have internet then no internet. the alert comes up and works just fine. but, when i have no internet and then i get internet the same alert pops up my code is -(void)reachabilityBlock { // allocate a reachability object Reachability * reach = [Reachability reachabilityWithHostname:@"www.google.com"]; // tell the reachability that we DONT want to be reachable on 3G/EDGE/CDMA reach.reachableOnWWAN = YES; reach

Two Alert Views in One View Controller - buttonIndex Response

孤街醉人 提交于 2019-12-04 01:28:34
问题 I am trying to perform the smile task of having two alerts in a single View Controller. The code below works fine, but how would I make another instance of it elsewhere in the View Controller. I am concerned that if I duplicated the code, my buttonIndex would not know which alert it is responding to. Any ideas? Thanks! -(void)alertChoice { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Confirm",