Following is a small snippet out of my TouchTracker main code where i’m having an issue related to retain cycle. [rootObj.completeLines removeAllObjects] has been taken from clearAllLines method. The snippet below is based on the control flow that the running program follows and thus is not a chunk out of the TouchDrawView.m line by line.
[rootObj.completeLines removeAllObjects];// the issue..
In the above snippet rootObj.completeLines is an NSMutableArray to which a ‘Line’ object has been added. containingArray is a strong type pointer/property. Clearly this forms a retain cycle between the NSMutableArray object and the ‘Line’ object… In the next line i pass the removeAllObjects message to the array… My question is, how come this message be able to purge an object (Line in this case) which is engaged in a retain cycle with another object (the Array). Clearly i must be missing something crucial here. Pls assist…