automatic ref counting - iOS: destroy subviews in viewDidDisappear? -


i have uinavigationcontroller uiviewcontroller pushed onto it. in viewcontrollers view, have 2 subview uiscrollviews. recreate these scrollviews every time in viewwillappear method in viewcontroller , add them subviews viewcontroller's view. using arc, should destroying 2 scroll views in viewdiddisappear method? better practice memory usage.

edit: did investigation, , without removing scroll views , setting them nil in viewdiddisappear method, not released. viewcontroller's view gets increasing number of subviews viewwillappear called. mentioned in comments, never deallocate main viewcontroller. stays on navigation controller's stack. why must manually release scroll views?

it may not necessary @ all. if uiviewcontroller removed screen , being deallocated, automatically deallocate view hierarchy (including subviews have added). easy way check override dealloc methods of classes you're interested in (using objc category method added class), , log message indicate they've been removed.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -