私のアプリ名はPropertiesSearchであるため、プロジェクトには次のファイルが含まれています。
PropertiesSearchAppDelegate.h
PropertiesSearchAppDelegate.m
PropertiesSearchViewController.h
PropertiesSearchViewController.m
次のように、PropertiesSearchAppDelegate.h でインスタンス変数 (ListingNav) を宣言しました。
#import <UIKit/UIKit.h>
@class PropertiesSearchViewController;
@interface PropertiesSearchAppDelegate : NSObject <UIApplicationDelegate> {
UINavigationController *ListingNav;
}
@property (nonatomic, retain) UINavigationController *ListingNav;
@end
そしてPropertiesSearchAppDelegate.mに、追加しました
@synthesize ListingNav;
今、私は次のように PropertiesSearchViewController.m から ListingNav にアクセスしようとしています:
PropertiesSearchAppDelegate *appDelegate = (PropertiesSearchAppDelegate *)[[UIApplication sharedApplication] delegate];
// Then here I can easily do appDelegate.ListingNav etc...
しかし、デバッガーは表示されています:
宣言されていない識別子 PropertiesSearchAppDelegate の使用
PropertiesSearchViewController.hにPropertiesSearchAppDelegate.hをインポートする必要がありますか?
あなたの助けのために前もってThx
ステファン