ios - UIToolbar Button not firing method -
ok, i've added custom uitoolbar instance in app programmatically. reason it's not firing method it's supposed to. i'm no expert in coding xcode. please help! missing? here's code
uiimage *imagenfacebook = [uiimage imagenamed:@"facebook.png"]; uiimage *imagendescargas = [uiimage imagenamed:@"descargas.png"]; uiimage *imagenvideo = [uiimage imagenamed:@"videos.png"]; uiimage *imagenrecetas = [uiimage imagenamed:@"recetas"]; uibarbuttonitem *toolfacebook = [[uibarbuttonitem alloc] initwithimage:imagenfacebook style:uibarbuttonitemstyleplain target:self action:@selector(test:)]; uibarbuttonitem *tooldescargas= [[uibarbuttonitem alloc] initwithimage:imagendescargas style:uibarbuttonitemstyleplain target:self action:@selector(test:)]; uibarbuttonitem *toolvideo = [[uibarbuttonitem alloc] initwithimage:imagenvideo style:uibarbuttonitemstyleplain target:self action:@selector(test:)]; uibarbuttonitem *toolrecetas = [[uibarbuttonitem alloc] initwithimage:imagenrecetas style:uibarbuttonitemstyleplain target:self action:@selector(test:)]; nsarray *itemsarray = [nsarray arraywithobjects:toolvideo, flexiblespacebtn,tooldescargas,flexiblespacebtn, toolrecetas,flexiblespacebtn,toolfacebook, nil]; [herramientas setitems:itemsarray]; and method goes this:
- (void)test:(id)sender{ uialertview *alert = [[uialertview alloc] initwithtitle:@"rofl" message:@"dee dee doo doo." delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil]; [alert show]; } why not working? there way check if it's firing it? it's not showing alert im not sure if it's alert or button not firing method. unfortunately, cant use nslog check because augmented reality app won't run on simulator nor let me check console.
sure, here's code toolbar herramientas, lot
******thanks replies guys, here's code uitoolbar
uitoolbar *herramientas = [[uitoolbar alloc]initwithframe:cgrectmake(0, [[uiscreen mainscreen] bounds].size.height - 70, [[uiscreen mainscreen] bounds].size.width, 70)]; herramientas.barstyle = uibarstyledefault; herramientas.translucent=no; herramientas.bartintcolor=[uicolor orangecolor]; [self.view addsubview:herramientas];
Comments
Post a Comment