Most likely, you are over-releasing iTouren
and, thus, that call to release
is causing the crash. That is, iTouren
is already deallocated by the time you release the containing array and when that containing array sends release
to the already deallocated iTouren
your app crashes.
(Of course, iTours
might be the object that is already deallocated. In any case, it is an over-release problem.)
Turn on zombie detection and see if that barfs up the specific problem.
Note that the
number returned by retainCount
is useless
. Absolute retain counts are an implementation detail and will often be a specific value that seems like nonsense.
In this case, the final release
of an object does not decrement the retain count. Why? Because that'd be a wasted cycle when the object is about to be deallocated anyway. It would be impossible for retainCount
to return 0 because, by definition, an object with a retain count of 0 has already been deallocated and, thus, is no longer a viable message receiver anyway.