Explain how an autorelease pool works at the runtime level



Explain how an autorelease pool works at the runtime level..

Answer / Anuj Baliyan

An autorelease pool in iOS manages objects that have been sent autorelease messages. It collects these objects and releases them automatically when the pool is drained, typically at specific points during the runloop execution.
1. Create an autorelease pool by calling [[NSAutoreleasePool alloc] init] or @autoreleasepool { ... } block.
2. Add objects to the pool by sending them autorelease messages.
3. Drain the pool by calling [pool drain], which releases all allocated objects and invalidates the pool object.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Interview Questions

Tell me what is iphone os?

1 Answers  


If you use location services in your app, will it drain your battery.if yes? How can we avoid?

1 Answers  


In which language ios is written?

1 Answers  


What are all the difference between categories and subclasses in iOS operating system?

1 Answers   TryTechnicals Pvt Ltd,


What is iphone os?

1 Answers  


What are the popular apps of iphone?

1 Answers  


What is a weak var?

1 Answers  


What persistent storage used in mobile apps - ios?

1 Answers  


How would you create your own custom view?

1 Answers  


What is nsoperationqueue?

1 Answers  


Would I be able to keep in touch with some c++ work in the equivalent .m record? Will it compile? Assuming no, what changes would it be a good idea for me to do to compile it?

1 Answers  


Explain me what is polymorphism?

1 Answers  


Categories