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

  • Home
  • SEARCH
  • 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 7660397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:27:36+00:00 2026-05-31T13:27:36+00:00

After reading apple’s example: MultipleDetailViews which demonstrates how to use UIPopOverController with two detail

  • 0

After reading apple’s example: MultipleDetailViews which demonstrates how to use UIPopOverController with two detail view controllers, I can’t figure out how to add a custom view to the barButtonItem which exist in the splitViewController delegate method:

-(void)splitViewController:(UISplitViewController*)svc willHideViewController: (UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController:(UIPopoverController*)pc {

    self.popoverController = pc;
    barButtonItem.text = @"root view controller";
    self.rootPopoverButtonItem = barButtonItem;

    UIViewController <SubstitutableDetailViewController> *detailViewController = [mySplitViewController.viewControllers objectAtIndex:0];
    [detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
}

the popover button works well with its default shape, but when I try something like this:

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *customImage = [UIImage imageNamed:@"popOver.png"];
[button setBackgroundImage: [UIImage imageNamed:@"popOver.png"] forState:UIControlStateNormal];
button.frame= CGRectMake(0.0, 0.0, customImage.size.width, customImage.size.height);
[button addTarget:self action:@selector(???) forControlEvents:UIControlEventTouchUpInside];
barButtonItem.customView = button;

I do not know what is the selector for this button that will get the popover to show correctly, my popover works well without a selector using the delegate methods of the UISplitViewController, so what kind of selector should I put here ?

  • 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-05-31T13:27:37+00:00Added an answer on May 31, 2026 at 1:27 pm

    Why are you adding a button to the bar button item instead of an image view? Using an image view (or disabling user interaction on the button) will cause the application to use the bar button item selector and target.

    If you still want to use a separate button, then what you can do is:

    [button addTarget:barButtonItem.target action:barButtonItem.action forControlEvents:UIControlEventTouchUpInside];
    

    This will copy over the default bar button item target and action.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After doing some reading I notice Apple pushes the use of delegates on controllers
I'm customizing a tableviewcell which is still very hard to me. After reading apple's
After reading the answer to this question , I learned that SFINAE can be
If I'm an Apple Push Notification provider for multiple iOS apps can I use
After reading this post regarding the use ECC to implement the hashing using aa
After reading lots of blogs, forum entries and several Apple docs, I still don't
After reading a few questions on what Java data type to use for currency/money,
So, after several hours of reading the Apple walkthrough I finally managed to deploy
I'm new in iPhone development and after reading Apple documentation and several posts here
After reading the Head First Design Patterns book and using a number of other

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.