ios - why it is recommended to use the _weak reference with delegates -



ios - why it is recommended to use the _weak reference with delegates -

hi every 1 whether 1 elaborate me why recommended utilize _weak reference delegates , not strong reference? though can utilize strong reference delegates. some 1 please tell me improve , descriptive illustration simple way in situations should utilize strong reference , in situations should utilize _weak reference delegates.

i went through 1 of related question on stack overflow

is ever ok have 'strong' reference delegate?

but did not clear concept properly.

any help highly appreciated !!

thanks.

using __strong on delegate easy create retain cycle:

say has strong reference b, , object set delegate of b, if delegate referenced, then, retain cycle formed.

ios iphone objective-c delegates retain-cycle

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -