Do agent/controller objects (nothing is referring to them) get released (Objective-C, ARC)?

StackOverflow https://stackoverflow.com/questions/23077272

문제

I am writing a singleton that will be instantiated in the AppDelegate, but I don't need a reference from AD to it. It is a controller reacting to app state changes.

Since it's not sitting on the main reference tree, will it be auto-released on the next pass (or however it's called when auto-releasing of objects occurs)?

도움이 되었습니까?

해결책

As Neil Daniels pointed out, I am assigning the singleton instance to a static var, which should preserve the object from being released.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top