I have an UITabBarController
with two tabs:
UINavigationController
OptionsViewController : UIViewController
I usually set IBOutlets in each of my viewcontrollers which point to the other controller. So if I had view controllers A and B. A has an IBOutlet to B and B to A. Then whenever I want to access anything in B from A i just use a dot operator on B.
In your example UINavigationController would #include "OptionsViewController.h"
and have an ivar IBOutlet OptionsViewController * ovc
(which is set in IB) and then any instance variable from your options view controller can be referenced as ovc.UILabel.text
from the navigation controller. This process can be reversed to access values from your navigation controller in your options view controller.
Example Navigation Controller (.h):
#include "OptionsViewController.h"
@interface UINavigationController // (whatever the name of this class is)
{
OptionsViewController * ovc;
}
@property (nonatomic, retain) IBOutlet OptionsViewController * ovc;
@end
Example OptionsViewController.h:
@interface OptionsViewController
{
UILabel * label;
}
@property (nonatomic, retain) IBOutlet UILabel * label;
@end
Then from UINavigationController (.m) you can just write ovc.label.text
to access the text.