I study manual memory management and I wonder when autorelease pools drain.
There is 3 situations, that I found:
1 - in the main.m, start from application running and drains on end, therefore releasing all of objects in memory.
2 - when you explicitly create an autorelease pool manually and drain it
Third case is what I'm asking for, and its kind of confusing for me.
As I studied, autorelease objects just like automatic variables in C, that exist only in a logical scope (in function body). Therefore, I suppose that after each function there is a hidden [pool drain];
But, it was pointed out to me that it's not correct as I thought. Apple says, that it drains after an "event". That event might occur when user hit button, table view is reloaded for example.
But that information is not enough to see the whole picture. Could you please clarify for me, when exactly a pool drains for objects, like NSArray *arr = [NSArray array];?
