ipad - how to call a function as user click on search in alert view iphone -
//---------searchoing----- //
- (ibaction) search_hadit  {     uialertview *alert = [[uialertview alloc]                        initwithtitle:@"search"                       message:@" "                       delegate:self                        cancelbuttontitle:@"cancel"                        otherbuttontitles:@"search",                       nil];       cgrect frame = cgrectmake(14, 35, 255, 23);     mytextfield = [[uitextfield alloc] initwithframe:frame];     mytextfield.borderstyle = uitextborderstylebezel;     mytextfield.textcolor = [uicolor blackcolor];     mytextfield.textalignment = uitextalignmentcenter;     mytextfield.font = [uifont systemfontofsize:14.0];     mytextfield.placeholder = @"enter query";     mytextfield.backgroundcolor = [uicolor whitecolor];     mytextfield.autocorrectiontype = uitextautocorrectiontypeno; // no auto correction support     mytextfield.keyboardtype = uikeyboardtypedefault;// use default type input method (entire keyboard)     mytextfield.returnkeytype = uireturnkeydone;     mytextfield.delegate = self;     mytextfield.clearbuttonmode = uitextfieldviewmodewhileediting; // has clear 'x' button right     [alert addsubview:mytextfield];     [alert show];     [alert release]; }     when click search button in app alert view show...
 want when user click search button text enter , send data function on click search button can perform search. idea?
i guess (acording title) you'll need uialertviewdelegate or @ least function:
- (void)alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex {     nsstring* buttontitle = [alertview buttontitleatindex:buttonindex];    if ([buttontitle equaltostring:@"search"]) {       [do something];    } }   but text in description describes different problem title. can't provide solution that, though.
Comments
Post a Comment