Add UIAlertview and UITextField using Interface Builder to take passcode as user input.
Add UIAlertview and UITextField using the following code:
UIAlertView *passCodeAlertView = [[UIAlertView alloc] initWithTitle:@"Enter application passcode:" message:@"\n" delegate:self cancelButtonTitle:@"Log In" otherButtonTitles:nil]; CGRect frame = CGRectMake(12.0, 45.0, 260.0, 30.0); //(20.0, 45.0, 245.0, 25.0) //(12.0, 64.0, 260.0, 30.0) UITextField *l_passCodeTextField = [[UITextField alloc] initWithFrame:frame]; l_passCodeTextField.placeholder = @"Passcode"; l_passCodeTextField.borderStyle = UITextBorderStyleRoundedRect; //UITextBorderStyleBezel l_passCodeTextField.keyboardAppearance = UIKeyboardAppearanceAlert; l_passCodeTextField.secureTextEntry=YES; l_passCodeTextField.keyboardType = UIKeyboardTypeDefault; l_passCodeTextField.returnKeyType = UIReturnKeyDone; l_passCodeTextField.autocapitalizationType=UITextAutocapitalizationTypeNone; l_passCodeTextField.clearButtonMode = UITextFieldViewModeWhileEditing; l_passCodeTextField.delegate = self; l_passCodeTextField.tag = 100; [l_passCodeTextField becomeFirstResponder]; [passCodeAlertView addSubview:l_passCodeTextField]; [passCodeAlertView show]; [passCodeAlertView release]; [l_passCodeTextField release];