Autoreleased objects are added to an instance of an autorelease pool (NSAutoreleasePool), which is drained at some point, usually at the end of the current runloop (if not manually).
So the end of a scope, method, if statement, etc, won't drain the pool. Your object will receive a release message only when the pool is drained, so it will still be valid for some time after your method has returned.