in iPhone: When I add a subview to a view, using [myview addsubview: anotherview.view ] will “my view” retain in memory which may cause a problem when adding a big number of views as subviews.
in iPhone: When I add a subview to a view, using [myview addsubview: anotherview.view
Share
Yes addSubView retains the subViews you add, and yes if you add way too many subViews you could run into memory issues, but that is highly unlikely, if that happens you will receive the
Followed by the:
and then:
This will unload your view, and release its subviews. However don’t forget to set the additional subViews to nil on the viewDidUnload method, as that subviews are also retained by the ViewController itself, therefore they will not get released when the view unloads, unless you set them to nil here.