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 |
Tell me what is iphone os?
If you use location services in your app, will it drain your battery.if yes? How can we avoid?
In which language ios is written?
What are all the difference between categories and subclasses in iOS operating system?
1 Answers TryTechnicals Pvt Ltd,
What is iphone os?
What are the popular apps of iphone?
What is a weak var?
What persistent storage used in mobile apps - ios?
How would you create your own custom view?
What is nsoperationqueue?
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?
Explain me what is polymorphism?