Create a prompt box
// Create a hint box Uialertview * Alertview = [[Uialertview alloc]initwithtitle:@ ' warning " message:@" Saddam's ready to fight. delegate : Self Cancelbuttontitle:@ " cancel " Otherbuttontitles:@" OK ", @" Not sure , nil];
Set the Cue box style
Alertview. Alertviewstyle = uialertviewstyleplaintextinput; /* typedef ns_enum (Nsinteger, Uialertviewstyle) { Uialertviewstyledefault = 0, Uialertviewstylesecuretextinput, ciphertext input uialertviewstyleplaintextinput, plaintext input Uialertviewstyleloginandpasswordinput Clear text + ciphertext } __tvos_prohibited ; */
Let Alertview show it.
[Alertview show];
To set the proxy implementation Protocol method
Alertview. delegate = self;
#pragmamark-uialertviewdelegate-(void) Alertview: (Uialertview *) Alertview Clickedbuttonatindex: (nsinteger) buttonindex{if(Buttonindex = =0) {NSLog (@"Click the Cancel"); NSLog (@"%@", [Alertview Textfieldatindex:0].text); }Else{NSLog (@"clicked OK."); }}
It is not recommended to use after iOS9
Uialertcontroller+uialertcontrollerstylealert can also achieve the same function
iOS opening--ui ualertview (cue box)