I have a view controller who's views are loaded from a nib file. The nib file contains the main view, which has a scroll view as its subview. Inside view controller's viewDidLoad method, the retain count of the scroll view is 2 (1 for when it was created, and 1 because I retain it). When the view controller's dealloc method is being called, I release the scroll view, but its retain count only decreases to 1, which makes sense since it was 2 at the beginning.
Based on the above scenario, my question is: does the scroll view get fully released after the dealloc method returns, because it is then that the main view is released, forcing all of its subviews (such as the scroll view), to be removed/released? Or, does this release happen at a different point in time?
Thanks!
EDIT: If after I release the scroll view, I set it to nil (while the retain count is still 1), will that scroll view ever get fully released?