Reloaddata needs to execute within the parentviewcontroller because it invokes the tableview delegate methods to reload the table such as CellForRowAtIndexpath, and many more.
This means you need to define a public method in the parentviewcontroller that will contain the reloaddata command and call it from the child view controller.
public Method:
Parentviewcontroller.h
@interface
-(void) reloadTable:(id) sender;
parentviewcontroller.m
@implementation
- (void) reloadTable:(id) sender {
[self.tableview reloaddata];
return;
}
childviewcontroller.h
#import parentviewcontroller.h
@class parentviewController
@interface childviewcontroller :UIViewController (or UITableViewController)
@property (nonatomic, strong) parentViewController *parent;
childviewController.m
@implementation
@synthesize parent;
/* Note the parent instance is passed from the parent to the child view controller,
it is not allocated and initialised in the child controller - many ways to do this
depending on coding style */
/* after updating the data */
[parent reloadTable];
init
your controller, do it with a singleton. Then, from anywhere you can call [[Controller sharedInstance].tableView reloadData], assuming tableView is a public property.