I have protocol and class header in one file:
@protocol SomethingDelegate
- (void) doSomething;
@end
@interface SomethingClass
@property (nonatomic, weak) id <SomethingDelegate> delegate;
@end
On the .m file:
@implementation SomethingClass // in here I got error "Cannot synthesize weak property in file using manual reference counting"
@end
If I change it into like this:
@implementation SomethingClass
@synthesize delegate; // in here I got error "Cannot synthesize weak property in file using manual reference counting"
@end
Why is this happened? And how to fix this? The error disappear if I change from weak
to strong
. But that's not how delegate should be declared, right? How to properly declare a weak delegate?