libextobjc icon indicating copy to clipboard operation
libextobjc copied to clipboard

@strongify(self.delegate); not working

Open Ricardo1980 opened this issue 10 years ago • 2 comments

Hello mates!

I receive: "/WAMOverviewView.m:306:10: Weak property 'delegate' is accessed multiple times in this method but may be unpredictably set to nil; assign to a strong variable to keep the object alive"

I try ti use @strongify(self.delegate); Or @strongify(self->_delegate); but I receive: "WAMOverviewView.m:304:16: Redefinition of 'self' with a different type: 'id<WAMOverviewViewDelegate> _Nullable __strong' vs 'WAMOverviewView *const __strong' "

Any idea or suggestion? Thanks a lot.

Apart from that, in other parts of the program I tried to use @strongify(self, self.delegate) but doesn't work. Am I missing something? Thanks.

Ricardo1980 avatar Dec 07 '15 17:12 Ricardo1980

Looks like weakify/strongify does not support dot-separated identidiers, try:

@weakify(_delegate)

k06a avatar Jan 10 '16 17:01 k06a

self.delegate is not a variable, but a statement

rickytan avatar Sep 14 '18 13:09 rickytan