ARC Gotcha – Unexpectedly Short Lifetimes
ARC Gotcha – Unexpectedly Short Lifetimes:
ARC is within its rights to release the object between fetching the
CGColor
and setting the layer’s background color. ARC variables are released as soon as the optimizer decides that they are no longer referenced, so the compiler is free to release uicolor after fetching theCGColor
. Current compiler implementations do seem to wait until the end of scope, but that’s not guaranteed.
(Via Big Nerd Ranch Weblog)
Interesting gotcha with ARC.