Question: I have 2 class, classA and classB.

ObjectA have a property which is ObjectB. Now the scenario is-

1. ObjectA call ObjectB method- [ObjectB methodB1].
2. after executing method [ObjectB methodB1], objectB send callback to objectA.
3. getting callback ObjectA release ObjectB. did it following way-

[ObjectB release];
ObjectB = nil;
4. ObjectB has another method ->methodB2, which starts executing [ObjectB methodB2] just after sending callback to objectA and it crashes because ObjectA released ObjectB when it's executing, so there is no object then ObjectB.

So if how to solve this problem?

Thanks for your answer.

Answer: 
move your callback to ObjectA just after the execution of [ObjectB methodB2].
Or create two callbacks : one after [ObjectB methodB1] and another after [ObjectB methodB2] and release ObjectB after the second callback
`methodB1` should retain `self` when it starts and release it when it finishes.