Doom
Doom

Reputation: 1278

Refresh table under popover iOS?

Hi i have create 2 class tableView, the first class from a cell call popover that contains a second class with xib, when i pressed for call popover all work, but how can refresh first table with popover open? I call popover in this way from a cell:

Second *add=[[Second alloc] init];


            popoverController = [[UIPopoverController alloc] initWithContentViewController:add];
            popoverController.popoverContentSize = CGSizeMake(320, 300);
            popoverController.delegate = self;
            UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];


            [popoverController presentPopoverFromRect:cell.bounds inView:cell.contentView
                             permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];

Only when i pressed out popover i receive popoverControllerDidDismissPopover (from first class) and the first class is refresh table.

Upvotes: 0

Views: 375

Answers (1)

BornCoder
BornCoder

Reputation: 1066

Below should be the right steps to achieve what you want.

  1. You should create @protocol to make delegate property in side second class which you are showing inside Popover.
  2. That protocol methods should be implemented inside first class from where you are presenting popover and where you want to refresh your UITableView
  3. Using this delegate object of protocol, you should be calling protocol method to refresh the first class tableView.

Upvotes: 1

Related Questions