NSAutoreleasePool supports Cocoa’s memory management system and it stores objects that are sent when the pool is drained. When you use Automatic Reference Counting, you cannot use autorelease pools. So, you should use @autoreleasepool blocks. For example, instead of:
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Code benefitting from a local autorelease pool.
[pool release];
You would write:
@autoreleasepool
{
// Code benefitting from a local autorelease pool.
}
BY Best Interview Question ON 13 Jan 2019