ARC Gotcha – Unexpectedly Short Lifetimes

ARC Gotcha – Unexpectedly Short Lifetimes:

ARC is within its rights to release the object between fetching theCGColor 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 the CGColor. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.