My app name is PropertiesSearch so the project contains the following files:
PropertiesSearchAppDelegate.h
PropertiesSearchAppDelegate.m
PropertiesSearchViewController.h
PropertiesSearchViewController.m
I declared an instance variable (ListingNav) in PropertiesSearchAppDelegate.h like this:
#import <UIKit/UIKit.h>
@class PropertiesSearchViewController;
@interface PropertiesSearchAppDelegate : NSObject <UIApplicationDelegate> {
UINavigationController *ListingNav;
}
@property (nonatomic, retain) UINavigationController *ListingNav;
@end
and in PropertiesSearchAppDelegate.m, I added
@synthesize ListingNav;
Now I'm trying to access ListingNav from PropertiesSearchViewController.m like this:
PropertiesSearchAppDelegate *appDelegate = (PropertiesSearchAppDelegate *)[[UIApplication sharedApplication] delegate];
// Then here I can easily do appDelegate.ListingNav etc...
But debugger is showing:
Use of undeclared identifier PropertiesSearchAppDelegate
Should I import PropertiesSearchAppDelegate.h in PropertiesSearchViewController.h ?
Thx in advance for your help
Stephane