私はこのようなファイルを含んでいます:
#import "BannerPhoneContentController.h"
しかし、私はこのように使用しようとすると:
bannerContentController = [[BannerPhoneContentController alloc] init];
私はエラーが表示されます:
Use of undeclared identifier 'BannerPhoneContentController';
一見、私のインポートを無視するコードを引き起こす可能性がありますか?
これはバナーコンテンツコントローラのヘッダーです。
#import
#import
#import "BannerContentController.h"
@interface BannerPhoneContentController : BannerContentController
{
UIScrollView *scrollView;
UIPageControl *pageControl;
NSMutableArray *viewControllers;
//To be used when scrolls originate from the UIPageControl
BOOL pageControlUsed;
}
@property (nonatomic, retain) UIScrollView *scrollView;
@property (nonatomic, retain) UIPageControl *pageControl;
@property (nonatomic, retain) NSMutableArray *viewControllers;
- (IBAction)changePage:(id)sender;
@end
EDIT bannerContentController is of type BannerContentController NOT BannerPhoneContentController. The latter is a subtype of the former. It is definitely worth noting that this exact code works just fine in another app, so it's nothing to do with the code itself - just how it's being included apparently. I'm stumped.
EDIT ok found the problem - not sure how to fix it. I generated the preprocessed file and the header file it's included is in fact this:
#import
#import
#import "ContentController.h"
@interface PhoneContentController : ContentController
{
UIScrollView *scrollView;
UIPageControl *pageControl;
NSMutableArray *viewControllers;
//To be used when scrolls originate from the UIPageControl
BOOL pageControlUsed;
}
@property (nonatomic, retain) UIScrollView *scrollView;
@property (nonatomic, retain) UIPageControl *pageControl;
@property (nonatomic, retain) NSMutableArray *viewControllers;
- (IBAction)changePage:(id)sender;
@end
その差異に注意してください - すべてのバナーがありません。これは、ファイルのように見えるものです。しかし、私はチェックして、プロジェクトにあるファイルが私がトップに投稿したものであることを確認しました。私は解決策と建物の清掃を再試行しました。どうすればこの問題を解決できますか?なぜ起こったのですか?
EDIT The file that I'm including all this in is part of a code library. I have now created a new project, imported the code library and included all of this in that library once again in exactly the same way. and it works. I have looked over the two projects and the code in question is identical. This must be a project setting?