I've got an app I'm working on, its got 4 views so far that work fine, I've added another view (with .h & .m files) and now it wont compile. I've copied the code from the other lines but cannot figure out the problem.
the error is on line IBOutlet fifthViewController *fifthViewController;
#import <UIKit/UIKit.h>
@class FirstViewController;
@class SecondViewController;
@class ThirdViewController;
@class ForthViewController;
@class fifthviewcontroller;
@interface MulipleViewsViewController : UIViewController {
IBOutlet FirstViewController *firstViewController;
IBOutlet SecondViewController *secondViewController;
IBOutlet ThirdViewController *thirdViewController;
IBOutlet ForthViewController *forthViewController;
IBOutlet fifthViewController *fifthViewController;
}
@property (retain, nonatomic) FirstViewController *firstViewController;
@property (retain, nonatomic) SecondView开发者_Go百科Controller *secondViewController;
@property (retain, nonatomic) ThirdViewController *thirdViewController;
@property (retain, nonatomic) ForthViewController *forthViewController;
@property (retain, nonatomic) fifthviewcontroller *FifthViewController;
-(IBAction) loadSecondView:(id)sender;
-(IBAction) loadThirdView:(id)sender;
-(IBAction) loadFirstView:(id)sender;
-(IBAction) loadForthView:(id)sender;
-(IBAction) loadFifthView:(id)sender;
-(void) clearView;
@end
I think the problem is here:
@property (retain, nonatomic) fifthviewcontroller *FifthViewController;
it should be:
@property (retain, nonatomic) Fifthviewcontroller *fifthViewController;
and of course
IBOutlet fifthViewController *fifthViewController;
should be:
IBOutlet FifthViewController *fifthViewController;
here too:
@class fifthviewcontroller;
should be
@class FifthViewcontroller;
When you declare the class and property, you use fifthviewcontroller
with no capitals, but when you declare the instance variable, you capitalize the V and C: fifthViewController
. From the context, it appears that the capitalizations are a mistake and that line should be changed to IBOutlet fifthviewcontroller *fifthViewController;
In the future, when posting about errors, please indicate in the code which line the error occurs on.
精彩评论