質問

zThis is based on a question I asked here which I have made good progressed already:

custom uitableviewcell will not display label texts

I basically followed the tutorial that was provided for me.

http://brianflove.com/2012/12/10/how-to-create-an-ipad-popover-view/

QUESTION

Now my issue is, I have to dynamically generate my ui bar buttons as if I just drag and drop it on the storyboard I am limited to one on the left and one on the right. This is my code to generate my button

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithTitle:@"Button" style:UIBarButtonItemStyleBordered target:self action:@selector(getMenu:)];
    self.navigationItem.leftBarButtonItems = [[NSArray alloc] initWithObjects:btn, nil];
}

Based on that tutorial I need to use a segue to popover the uitableview that I need. But that will require me to have an anchor point like so

enter image description here

So my question is, how do I add an anchor point to that UIBarButtonItem? I've been searching and I keep finding something regarding creating a custom popover class? Is this accurate?

役に立ちましたか?

解決

I solved this issue by creating an invisible UIView on the Navigation Bar itself and then use that as the anchor point for the segue. The issue with that is the "arrow" of the popover when the uiviewcontroller gets displayed is awkwardly placed. Still trying to figure that out.

This is where I got the answer from

https://stackoverflow.com/a/14514837/639713

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top