-1

I have a method which calls a block, and the block then reloads the tableview of the method of the tableviewcontroller reload data. however the trick is that the block is called inside of a different class. my question is how do i make it such that when i call [self.tableview reload data] it calls the parent class's function:

[pro refreshMatchesWithCallback:^ 
    {
        if ([pro.matches count] > 0) {
        //[self.tableView reloadData];
        NSLog(@"the count of a lifetime is %@", [pro.matches objectAtIndex:0]);
        }
    }];
michaela
  • 173
  • 1
  • 2
  • 13

2 Answers2

0

Use NSNotificationCenter and set the parent class up as a listener, or you can use a delegate method and fire that off.

LJ Wilson
  • 14,445
  • 5
  • 38
  • 62
0

So basically the question is more simpler, as the blocks are irrelevant.

The simple question is: How do I execute a method in another controller. And the simple answer is here

Community
  • 1
  • 1
Lefteris
  • 14,550
  • 2
  • 56
  • 95