Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8669735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:32:54+00:00 2026-06-12T18:32:54+00:00

How to replace buttons on a toolbar under UIWebView keyboard on iOS 6? The

  • 0

How to replace buttons on a toolbar under UIWebView keyboard on iOS 6?

The following code works fine on iOS 5.1 but doesn’t work on iOS 6:

UIWindow *keyboardWindow = nil;
for (UIWindow *testWindow in [[UIApplication sharedApplication] windows]) {
    if (![[testWindow class] isEqual:[UIWindow class]]) {
        keyboardWindow = testWindow;
        break;
    }
}
for (UIView *possibleFormView in [keyboardWindow subviews]) {
    // iOS 5 sticks the UIWebFormView inside a UIPeripheralHostView.
    if ([[possibleFormView description] rangeOfString:@"UIPeripheralHostView"].location != NSNotFound) {
        for (UIView *subviewWhichIsPossibleFormView in [possibleFormView subviews]) {
            if ([[subviewWhichIsPossibleFormView description] rangeOfString:@"UIWebFormAccessory"].location != NSNotFound) {
                UIBarButtonItem *buttonDone =[[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(pressDone)];
                NSArray *itemsArray;
                itemsArray = [NSArray arrayWithObjects:buttonDone, nil];
                [(UIToolbar*)subviewWhichIsPossibleFormView setItems:itemsArray];
            }
        }
    }
}

The error on iOS 6:

2012-09-27 16:31:13.537 Linux[2633:907] -[UIWebFormAccessory setItems:]: unrecognized selector sent to instance 0x1d886ad0
2012-09-27 16:31:13.540 Linux[2633:907] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWebFormAccessory setItems:]: unrecognized selector sent to instance 0x1d886ad0'
*** First throw call stack:
(0x361032a3 0x3441397f 0x36106e07 0x36105531 0x3605cf68 0x775c5 0x33bbda6f 0x360d85df 0x360d8291 0x360d6f01 0x36049ebd 0x36049d49 0x365862eb 0x37428301 0x7538d 0x75328)
libc++abi.dylib: terminate called throwing an exception
(lldb) 

Thanks a lot for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:32:56+00:00Added an answer on June 12, 2026 at 6:32 pm

    UIWebFormAccessory is no longer a UIToolbar on iOS6. It contains the UIToolbar you’re looking for, though. Use something like the following to find it on either OS version…

    + (UIToolbar *)findVirginWebKeyboardToolbar:(UIView *)parent
    {
        if ([parent isKindOfClass:[UIToolbar class]]) {
            // the stock toolbar contains a single item with a UISegmentedControl customView.
            UIToolbar *tb = (UIToolbar *)parent;
            if ([tb.items count] == 1 && [((UIBarButtonItem *)[tb.items objectAtIndex:0]).customView isKindOfClass:[UISegmentedControl class]]) {
                return tb;
            }
        }
    
        for (UIView *view in parent.subviews) {
            UIToolbar *tb = [self findVirginWebKeyboardToolbar:view];
            if (tb) return tb;
        }
    
        return nil;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code that works good on iOS 5.1 to replace buttons
My code is meant to replace radio buttons with dynamic ones, and allow clicking
i want to replace the bottom panel where we show Next,Back buttons with a
I would like to replace the Javascript confirm() function to allow custom buttons instead
I have a toolbar with various image buttons, created in Interface Builder. I'd like
I'm trying to use tinymce editor with facebox modal window. But tinymce doesn't load
I want to replace my radio buttons with images, here is my html which
A better explanation, I hope: I have a toolbar with 3 buttons on it,
I am trying to replace div elements with button elements to improve accessibility, but
I created following an asp.net page with tiny editor. It is Ok, good work.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.