> On Jul 12, 2017, at 2:57 PM, Jeremy Hughes <moon.rab...@virginmedia.com> > wrote: > >> On 12 Jul 2017, at 22:07, Quincey Morris >> <quinceymor...@rivergatesoftware.com> wrote: >> >>> Or there's something else going on under the covers. >> >> Yes, you are correct, betting *against* this assumption is a really, really >> terrible idea. Reasoning about the point at which objects actually >> deallocate is a code smell. > > I’m trying to understand memory management so I can avoid retain cycles and > other issues. > > … > > If I release the child view controllers of this top-level view controller (by > assigning an empty array to childViewControllers), my expectation is that I > don’t have to release every view controller and view in the hierarchy because > they are effectively owned by the top-level view controller.
While this discussion has been good at understanding underlying ARC and manual ref-count issues, my guess as to what's causing these issues is that you shouldn't just assign nil to the childViewControllers array. You should try calling: childVC.removeFromParentViewController() for each child view controller. Hopefully this is the source of your object-ownership issues. Doug Hill _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com