I have two view Controllers in my project ViewController
, SettingsView
. Here I am trying to update the ViewController\'s
label, when i
You have to implement protocols for that. Follow this:
1) In SettingView.h define protocol like this
@protocol ViewControllerDelegate
-(void) updateLabel;
@end
2) Define property in .h class and synthesis in .m class..
@property (nonatomic, retain) id viewControllerDelegate;
3) In SettingsView.m IBAction
-(IBAction)backToMain:(id) sender
{
[viewControllerDelegate updateLabel];
}
4) In ViewController.h adopt protocol like this
@interface ViewController
5) In viewController.m include this line in viewDidLoad
settingView.viewControllerDelegate=self