I came across this with almost every application that I have on the market. The difference is that I never dared to follow the storyboard path.
The way I could always do this is to provide access functions between controllers. You encounter a linker problem by defining a cross-defined controller as a simple type of UIViewController in the header of the parameter view, and then you include the header of the main view controller only in the .m file. Now, when you call the main view controller rutile from the parameter view, you will have to attribute it to the type of your main view controller!
You also need to provide a routine in the parameter view, which will allow you to set a variable that will contain a pointer to your main view controller for yourself.
An example for your view parameters
@interface optionsViewController : UIViewController{ UIViewController * myReactiveMainViewController; } -(void)setMyReactiveMainViewController:(UIViewController *)controller;
Not in .m file for View parameters
#import "myMainViewController.h" -(void)setMyReactiveMainViewController:(UIViewController *)controller{ myReactiveMainViewController = controller; }
In any other callback to the main view controller, you will need to do this:
-(void)returnToMain{ [(myMainViewController *)myReactiveMainViewController someCall:variable]; }
In this example, of course, suppose your myMainViewController implements a method called "someCall" that takes an input parameter.
source share