On Jul 12, 2017, at 1:16 PM, Jeremy Hughes <moon.rab...@virginmedia.com> wrote: > >> On 12 Jul 2017, at 19:25, Jens Alfke <j...@mooseyard.com> wrote: >> >>> >>> On Jul 12, 2017, at 10:57 AM, Jeremy Hughes <moon.rab...@virginmedia.com> >>> wrote: >>> >>> Wouldn’t it be ARC (rather than the consumer) that is balancing retains? >> >> Yes. ARC internally generates calls to -autorelease (or actually to some C >> functions in the runtime that invoke autorelease.) > > Well, my original example was of native Swift objects that are released > instantly and Cocoa objects that are not, and you suggested that the Cocoa > objects are using autorelease - which makes sense, because Cocoa has to > support ARC and non-ARC code. > > Is there any evidence that ARC is internally generating autorelease calls for > native Swift code?
It's also possible that, as an implementation detail, AppKit isn't disconnecting the view controller's view from the view hierarchy until it gets around to doing all the other view processing like redraws. If so then the view could be holding on to its view controller until that time. Or there's something else going on under the covers. Unless it's really important for you to expect that the child view controller has disappeared immediately then it's probably better just to assume that it has (or will) and move on to other things. _______________________________________________ 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