ipad build error - synthesized property must either be named the same
I downloaded the iPad programming example from pragprog site.
When I tried to compile Bezier1 example, I got 'syntehsized property 'window'...
error.
Why this error? How to solve this issue?
ADDED
@interface BezierAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
BezierViewController *viewCont开发者_运维技巧roller;
}
was missing.
It means that in the header "BezierAppDelegate.h" the variables window and viewController are not declared
Exactly what types they are supposed to be im not sure but there should be something like this.
@interface BezierAppDelegate : NSObject {
UIViewController *viewController;
UIWindow *window;
//other stuff too
}
@property (readwrite,assign) UIViewController *viewController;
@property (readwrite,assign) UIWindow *window;
But there might also be something like this.
@interface BezierAppDelegate : NSObject {
UIViewController *_viewController;
UIWindow *_window;
//other stuff too
}
@property (readwrite,assign) UIViewController *viewController;
@property (readwrite,assign) UIWindow *window;
In which case you need to synthesise like this
@synthesize viewController=_viewController,window=_window;
精彩评论