I have googled around but i can not get the answer. So i have 2 NSManagedObject class : A and B A has a relationship with B, and B has an inverse relationship with A. So in class A, the 'B' property is retain. And the same as in class B. Code: Class A : @property(nonatomic, retain) B *b; class B : @property(nonatomic, retain) A *a; I have to do something like this in my code : Code: aObject.b = bObject; bObject.a = aObject; Then how can i release them ?