On 4/17/2014 3:18 PM, Steven Schveighoffer wrote:
During the entire processing, you never increment/decrement a reference count,
because the caller will have passed data to you with an incremented count.
Just because ARC protects the data, doesn't mean you need to constantly and
needlessly increment/decrement references. If you know the data won't go away
while you are using it, you can just ignore the reference counting aspect.
The salient point there is "if you know". If you are doing it, it is not
guaranteed memory safe by the compiler. If the compiler is doing it, how does it
know?
You really are doing *manual*, not automatic, ARC here, because you are making
decisions about when ARC can be skipped, and you must make those decisions in
order to have it run at a reasonable speed.