I am trying to figure out how to declare my delegates without getting any errors. I realize now that delegates are supposed to have a weak reference, I was prior to this using (strong) refrencing which is obviously a bad thing…
So now I am declaring my delegates like this
class.h
//..
id <SearchViewParsedData> SearchViewdelegate;
//..
@property (weak, nonatomic) id <SearchViewParsedData> SearchViewdelegate;
however in my class.m where I have @synthesize‘d them I am getting this error.
Existing ivar ‘SearchViewdelegate’ for __weak property
‘SearchViewdelegate’ must be __weak
So how am I supposed to declare this?
In your
@interfacewhen you declare the ivar forSearchViewDelegate, you need to declare the ivar as weak too: