I have two UINavigationController in the appdelegate.h
{
UINavigationController *leftView;
UINavigationController *rightView;
UIWindow *window;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *leftView;
@property (nonatomic, retain) IBOutlet UINavigationController *rightView;
appdelegate.m
@synthesize leftView;
@synthesize rightView;
then in a different class
test.m
#import "appdelegate.h"
if I do:
[self leftView] pushViewController...; //(Everything is ok)
but if I change it to:
[self rightView] pushViewControll...; //it complains about ViewController may not respond to -rightView
You code seems right; what doesn’t seem right is that you’re including AppDelegate. If the code was in AppDelegate.m, it would probably work without any complaints by the compiler.
Instead, you’ve defined @property lines for each, but that is in AppDelegate.h, not test.h – but you’re using them in test.m. That is probably the source of the problem.
Interestingly, does the code actually run?