开发者

UIPopOverController issue

开发者 https://www.devze.com 2023-04-03 12:30 出处:网络
I am trying to display tableviewcontroller in a popover from a barbuttonitem like this : - (IBA开发者_开发技巧ction)sortData:(id)sender {

I am trying to display tableviewcontroller in a popover from a barbuttonitem like this :

- (IBA开发者_开发技巧ction)sortData:(id)sender {
    if(!sortViewController)
    sortViewController = [[SortDataViewController alloc] init];
    [sortViewController.tableView setDelegate:self];
    [sortViewController.tableView setTag:12];
    [sortViewController setIsMatter:YES];
    sortViewController.contentSizeForViewInPopover = CGSizeMake(150, 100);
    sortViewController._radioSelection = 0;
    [sortViewController.tableView reloadData];
}

    if(!popOverController) {
        popOverController = [[UIPopoverController alloc] initWithContentViewController:sortViewController];
     }
    [popOverController setPopoverContentSize:CGSizeMake(100, 100)];
    [popOverController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}

for the first time it got displayed for 1sec and automatically dismissed and from next time onwards it is not displaying at all. Can anyone please help me in this regard.


Set delegate for the UIPopOVerController...

    popOverController.delegate = self;


I am reloading the view after each second to test some requirement and forgot to disable it. So my view is reloading continuously and it's not giving enough time for popover to display it's view. Now I disabled it and the popover is working without any issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消