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 8408839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:44:31+00:00 2026-06-09T23:44:31+00:00

I have created a button in my text field and calling my bookMarks method.

  • 0

I have created a button in my text field and calling my bookMarks method. That works fine with iphone. If I create a button in a toolbar and call this method, still works fine. it’s just not working in my text field. is there a way to fix this problem? Thanks..

 [bookMarkButton addTarget:self action:@selector(bookMarks:) forControlEvents:UIControlEventTouchUpInside];

    locationField.leftView = bookMarkButton;

bookMarks method

- (void)bookMarks:(id)button {

    if (self.bookmarkPopoverController.popoverVisible) {
        [self.bookmarkPopoverController dismissPopoverAnimated:YES];
        self.bookmarkPopoverController = nil;
    } else {
        ViewBookmarkViewController * viewBookmarkViewController = [[[ViewBookmarkViewController alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
        viewBookmarkViewController.delegate = self;
        [viewBookmarkViewController setBookmark:[webView stringByEvaluatingJavaScriptFromString:@"document.title"]
                                        url:self.url];
        UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:viewBookmarkViewController] autorelease];

        navController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
            self.bookmarkPopoverController = [[[UIPopoverController alloc] initWithContentViewController:navController] autorelease];
            [self.bookmarkPopoverController presentPopoverFromBarButtonItem:button
                                                   permittedArrowDirections:UIPopoverArrowDirectionDown|UIPopoverArrowDirectionUp
                                                                   animated:YES];
        } else {
            [self presentModalViewController:navController animated:YES];
        }
    }

}
  • 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-09T23:44:33+00:00Added an answer on June 9, 2026 at 11:44 pm

    Why don’t u add ControlEvent for textField:

    [yourTextField addTarget:self action:@selector(bookMarks:) forControlEvents:UIControlEventTouchUpInside];
    

    EDIT: To differentiate buttons add Tag 0 and 1 to two buttons respectively;

    Now your method is:

    - (void)bookMarks:(id)sender 
    { 
      if([sender isKindOfClass:[UIButton class]]) 
      {
       UIButton *curBtn = (UIButton *)sender
       if([curBtn tag] == 0)
       {
         // any action for button 1
       }
       else if([curBtn tag] == 1)
       {
          //refresh uiWebView
       }
      }
     else
     {
       //your code
       //present your popover for ipad
       [[self.bookmarkPopoverController presentPopoverFromRect:yourtextFeild.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown|UIPopoverArrowDirectionUp animated:YES];
     }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a text field component with an 'x' button inside that will
Possible Duplicate: Doing a phone call in LWUIT I have created text field with
I have created add text field with appendTo() . .remove() functions also working fine.
I have created a dynamic text field and button. I want to apply UI
I am trying to create a rich text editor. I have created some buttons
I have event Button that creates text box in run time. Private Sub Button1_Click(ByVal
I have created a button CSS class that uses background images with different positions
I am new to iphone development. I have created a button in the view.
I have created one dynamic button in my application and I call the following
I have a button on my home screen that will add an edit text

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.