As I registered the my object as a property listener. Is it necessary for me to perform any sort of “unlistening” before I release the object.
Share
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.
You should not continue to observe objects you are not retaining (this applies to KVO, delegation, notification, any any other listener pattern). Here is the danger:
While there are several patterns that you may believe make the above impossible, they are all much more fragile than just unregistering yourself when you release the observed object, particularly in your dealloc.