objective c - Set UITextField to a "selected state" upon dismissing an alert -
i'm practicing on ios development , i'm making bmi calculator app.
apart labels, view includes 2 uitextfields - height_textfield
, weight_textfield
, , uibutton calculatebmi
.
i have implemented if/else conditions catch empty text fields. meaning if user leaves height_textfield
or weight_textfield
or both blank, uialertview pops telling user fill in required fields.
help:
i want respective uitextfield "selected" or in "editable" state (cursor , keyboard appears , ready input) upon dismissing alert. have tried adding protocol .h file , implementing the
- (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex
and think idea might implementing code relevant "[self.height_textfield editingmode??]
" in method can't figure out.
this source code bmicalculatorviewcontroller.m
file:
i have not touched .h
file (no variables or methods declared there.)
thank in advance kind help/solutions. if have more time spare, tips , best practices appreciated well! thanks!
becomefirstresponder
method need call on textfield , bring in editing mode.
- (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { [self.height_textfield becomefirstresponder]; }
Comments
Post a Comment