Created
January 19, 2013 19:27
-
-
Save patelrohan/4574559 to your computer and use it in GitHub Desktop.
From this ViewController.m I want to invoke updateTable in LeftViewController.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------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