开发者

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?

ipad build error - synthesized property must either be named the same

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜