Skip to content

Instantly share code, notes, and snippets.

@patelrohan
Created January 19, 2013 19:27
Show Gist options
  • Save patelrohan/4574559 to your computer and use it in GitHub Desktop.
Save patelrohan/4574559 to your computer and use it in GitHub Desktop.
From this ViewController.m I want to invoke updateTable in LeftViewController.m
//---------------------------------------ViewController.h---------------------------------------
@protocol LeftViewControllerProtocol <NSObject>
-(void)updateTable;
@end
@interface ViewController : UIViewController <CLLocationManagerDelegate,ViewControllerDelegate>
{
}
@property (nonatomic,strong) id <LeftViewControllerProtocol> leftViewControllerProtocol;
//---------------------------------------ViewController.m---------------------------------------
@implementation ViewController
@synthesize leftViewControllerProtocol;
@end
//---------------------------------------LeftViewController.h---------------------------------------
#import "ViewController.h"
@interface LeftViewController : UITableViewController <LeftViewControllerProtocol>
{
}
-(void)updateTable;
@end
//---------------------------------------LeftViewController.m---------------------------------------
- (void)viewDidLoad
{
[super viewDidLoad];
ViewController *vc=[[ViewController alloc]init];
vc.leftViewControllerProtocol=self;
[vc release];
}
-(void)updateTable
{
arrayHistory=[self getHistory];
[self.tableView reloadData];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment