objective c - Xcode: Multiple text lines in pop-up -
objective c - Xcode: Multiple text lines in pop-up -
i'm trying create text box multiple fields, i'm having problem getting sec show (as matter of fact, when type sec field in, causes text box not show together.)
here's have:
-(ibaction)popupcheckin { //uialertview *alertcheckin = [[uialertview alloc] initwithtitle:@"check in" message:@"please fill out next check in." delegate:self cancelbuttontitle:@"check in." otherbuttontitles:@"cancel.", nil]; //[alertcheckin show]; uialertview * alert =[[uialertview alloc ] initwithtitle:@"check in" message:@"please fill out next fields check in." delegate:self cancelbuttontitle:@"cancel" otherbuttontitles: nil]; alert.alertviewstyle = uialertviewstyleplaintextinput; uitextfield * namefield = [alert textfieldatindex:0]; namefield.keyboardtype = uikeyboardtypedefault; namefield.placeholder = @"your name"; alert.alertviewstyle = uialertviewstyleplaintextinput; uitextfield * hostfield = [alert textfieldatindex:1]; hostfield.keyboardtype = uikeyboardtypedefault; hostfield.placeholder = @"host name"; [alert addbuttonwithtitle:@"check in."]; [alert show];
when run code, error says "thread 1: signal sigabrt" , pop won't come @ all; when have name field, works fine.
what doing wrong sec text field? thanks!
i think error arises because type of uialertview
doesn't contain more 1 uitextfield, , when trying access sec raises nsrangeexception
. according docs.
https://developer.apple.com/library/ios/documentation/uikit/reference/uialertview_class/uialertview/uialertview.html#//apple_ref/occ/instm/uialertview/textfieldatindex:
objective-c xcode uitextfield uialertview
Comments
Post a Comment