I have never worked on non ARC based project. I just came across a zombie on my ARC based project. I found it was because of retain cycle.I am just wondering what is a retain cycle.Can
Could you give me an example for retain cycle?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A retain cycle is a situation when object
Aretains objectB, and objectBretains objectAat the same time*. Here is an example:You can fix a retain cycle in ARC by using
__weakvariables orweakproperties for your “back links”, i.e. links to direct or indirect parents in an object hierarchy:* This is the most primitive form of a retain cycle; there may be a long chain of objects that retain each other in a circle.