Emannuel Carvalho
Emannuel Carvalho

Reputation: 623

Property `_statusBarTintColorLockingControllers` at `UIApplication` keeping ViewController in memory

Using Xcode 8 new memory debugger I found out there was a ViewController in memory that shouldn't be there and the strong reference that was pointing to it was coming from this mysterious _statusBarTintColorLockingControllers array in UIApplication. Does anybody know where it comes from? And more importantly, how to take my VC out of it?

memory debugger

Upvotes: 15

Views: 675

Answers (3)

fabb
fabb

Reputation: 11735

_statusBarTintColorLockingControllers seems not to be the real issue here. I had the same memory graph until I resolved a retain cycle where I forgot weak on a delegate property.

Upvotes: 4

apitt
apitt

Reputation: 11

I had the same issue and it looks like this comes from overriding the preferredStatusBarStyle variables. I removed this and no longer had the references retained.

Upvotes: 0

Ivan Besarab
Ivan Besarab

Reputation: 1008

I was stuck with same problem when forgot to set some property to nil before dismiss my controller

Upvotes: 1

Related Questions