I have a UIViewController on a UINavigationStack, and from this UIView I load another view not on the stack, but as a preview. This view I download is just a preference view for the application that I overlay on what has ever been shown.
i.e.
myViewController <- on the stack button touch loads as a subview to myViewController
+ prefrencesViewController
My question is, is there a way to call a method that in myViewController from prefrencesViewController? I try to use delegates and protocols, but it doesnβt work, so I hope there is an easy way to do this that I donβt know about yet, or maybe I can get help with my delegate / protocol ...
This is what my code for configuring the delegate and protocol looks like
//prefrencesViewController.h
@protocol GetPrefrencesViewControllerDelegate <NSObject>
-(void)reloadViewFromSavedPrefrences;
@end
@property (nonatomic, weak) id <GetPrefrencesViewControllerDelegate> delegate;
//prefrencesViewController.m
@synthesize delegate;
[[self delegate] reloadViewFromSavedPrefrences];
//myViewController.h
#import "prefrencesViewController.h"
@interface myViewController : UIViewController <UITabBarDelegate, GetGUIEncodedData, GetPrefrencesViewControllerDelegate> {
prefrencesViewController *pvc;
@property (strong, nonatomic) prefrencesViewController *pvc;
//myViewontroller.h
@synthesize pvc;
- (void)viewDidLoad
{
[pvc setDelegate:self];
}
-(void)reloadViewFromSavedPrefrences {
NSLog(@"WORKED");
}