0

I wonder what is wrong with this?

.h file:

typedef enum {
    N4LoupeTypeRound,
    N4LoupeTypeRectangle,
} N4LoupeType;

@interface N4LoupeLayer : CALayer {
    N4LoupeType _type;
    UIView *_originalView;
    CALayer *_mask;
    CALayer *_overlay;
}

@property (nonatomic) N4LoupeType type;
@property (nonatomic, assign) UIView *originalView;

@end

.m file:

#import "N4LoupeLayer.h"

@interface N4LoupeLayer (Privates)

@property (nonatomic, retain) CALayer *mask;
@property (nonatomic, retain) CALayer *overlay;

@end

@implementation N4LoupeLayer

@synthesize type = _type;
@synthesize originalView = _originalView;
@synthesize mask = _mask;
@synthesize overlay = _overlay; // ******I GET THE ERROR HERE********* 

@end

No declaration of property 'overlay' found in the interface in N4LoupeLayer.m

nacho4d
  • 43,720
  • 45
  • 157
  • 240
  • Possible Duplicate of: http://stackoverflow.com/questions/743586/synthesizing-properties-in-categories – Akusete Jul 23 '10 at 02:28
  • Thanks for the link: Indeed the problem is the same. I should use Extensions and not Categories for this. – nacho4d Jul 23 '10 at 03:31

1 Answers1

2

You defined the properties for the Privatescategory, but you are trying to synthesize them in N4LoupeLayer.

apaderno
  • 28,547
  • 16
  • 75
  • 90
  • I just realized that I want a class extension and not a category. I should write @interface N4LoupeLayer () instead of @interface N4LoupeLayer (Privates) in the .m file. Even though, this is strange yet. why the error does not appear in _mask property? – nacho4d Jul 23 '10 at 03:30
  • When you don't use any categories, simply write `@interface N4LoupeLayer`. The reason of why you just see the error reported for `_overlay` is that probably the properties are handled in LIFO order. – apaderno Jul 23 '10 at 04:25