あらためてコードを起稿。
覚えておいて一気に書くには大変なのでコピペでなんとかなるように。
Delegateメソッドも忘れずに。
これはパスワードなどをアラートビューに入力できるようにするタイプのものです。
キーボードは数字入力になっているのでお好みで。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"コード入力" message:@"コードを入力してください。" delegate:self cancelButtonTitle:@"キャンセル" otherButtonTitles:@"確定",nil]; alert.tag = 0; alert.alertViewStyle = UIAlertViewStyleSecureTextInput; alert.delegate = self; [alert show]; LOG(@"%@",alert.textInputMode); [alert textFieldAtIndex:0].keyboardType = UIKeyboardTypeNumberPad; [alert resignFirstResponder];