0

I keep getting this property as undeclared when it should be available in the framework.

UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Email Alert" message:@"Enter your Email Address" delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:nil];
[alert setAlertViewStyle:UIAlertViewStyleSecureTextInput];
[alert show];
[alert release];
redoc01
  • 2,107
  • 5
  • 32
  • 64

3 Answers3

1

I have used UIAlertViewStylePlainTextInput in this way. Please modify the code as needed.

                 alertType = @"phoneNumberAlert";
                 UIAlertView *phoneNumberAlert = [[UIAlertView    
                 alloc]initWithTitle:@"Notice"     
                 message:@"Please enter your Phone Number" delegate:self 
                 cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
                 [phoneNumberAlert setAlertViewStyle:UIAlertViewStylePlainTextInput];
                 UITextField *alertTextField = [phoneNumberAlert textFieldAtIndex:0];
                 alertTextField.keyboardType = UIKeyboardTypeNumberPad;
                 [phoneNumberAlert show];
                 [phoneNumberAlert release];
york
  • 149
  • 1
  • 11
0

Did you implement properly methods of the UIAlertViewDelegate?

like this one (without renaming it)?

    - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  • Ok my bad! If it's due to your use of iOS4, check out this answer: http://stackoverflow.com/questions/4805637/uitextfield-inside-an-uialertview-not-working-in-ios4-1-and-works-in-3-0 – Baptiste Alexandre Jan 04 '13 at 16:19
0
> alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
>     [alertView textFieldAtIndex:0].keyboardType = UIKeyboardTypeNumberPad;
AzabAF
  • 632
  • 1
  • 4
  • 19