Add inputAccessoryView view on top of keyboard

Add inputAccessoryView view on top of keyboard
0.0 0



I trying to add next and previous button on navigation bar on top of keyboard. I was successfully added inputAccessoryView function in platform/ios/

- (UIView *)inputAccessoryView
    UIView* inputAccessoryView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 480, 34)];

    UIToolbar* keyboardToolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0,0,480,34)];
    keyboardToolbar.barStyle = UIBarStyleBlackTranslucent;
    keyboardToolbar.tintColor = [UIColor darkGrayColor];

    UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(dismissKeyboard)];
    UIBarButtonItem *flex = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];

    UISegmentedControl *control = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"Previous", @"Next", nil]];
    control.segmentedControlStyle = UISegmentedControlStyleBar;
    control.tintColor = [UIColor darkGrayColor];
    control.momentary = YES;
    [control addTarget:self action:@selector(nextPrevious) forControlEvents:UIControlEventValueChanged];     

    UIBarButtonItem *controlItem = [[UIBarButtonItem alloc] initWithCustomView:control];
    NSArray *items = [[NSArray alloc] initWithObjects:controlItem, flex, barButtonItem, nil];
    [keyboardToolbar setItems:items];

    [inputAccessoryView addSubview:keyboardToolbar];

    [control release];
    [barButtonItem release];
    [flex release];
    [items release];      

    return inputAccessoryView;

- (void) dismissKeyboard {
    CCLOG("click on done");

- (void) nextPrevious {
    CCLOG("click on next previous");

but my selector function will not working. an error come.

 -[EAGLView dismissKeyboard:]: unrecognized selector sent to instance 0x83641d0
2012-06-11 10:19:15.292 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[EAGLView dismissKeyboard:]: unrecognized selector sent to instance 0x83641d0'

please help me ASAP how to add target for call @selector functions.