Can Anyone Tell me why the function is Not Calling Here
Class MasterViewController.h
@interface MasterViewController : UITableViewController
- (void) populateTableView;
Class ModelViewController.h
#import "MasterViewController.h"
@interface ModelViewController : UIViewController
@property (strong, nonatomic) MasterViewController *MasterViewController;
Class ModelViewController.m
@synthesize MasterViewController;
[MasterViewController.self populateTableView]; // Function Calling
Here you declared a instance variable (property) with the name
MasterViewController, which is the same as its class name. When you sentpopulateTableViewmessage to MasterViewController, actually, the compile treated it as a Class Method (+ (void)populateTableView;) instead of Instance Method (- (void)populateTableView;).So you’d better declare this iVar to
masterViewControllerinstead (mis lower case).then alloc & use it in your method: