I have some simple doubts about NSOperation and GCD that I have not found answer to on the documentation.
The firs question is related to memory management:
I want to know if I need to create an Autorealease pool for the methods I wil add to the NSOperationQueue; similarly to when you run a method on different thread without NSOperations.
The next question is whether NSOperation takes care of GCD or if this needs to be done manually?
Thank you for your help!
According to the documentation, you should create an NSAutoreleasePool in the
mainmethod of your NSOperation. The documentation for NSInvocationOperation and NSBlockOperation doesn’t specify whether they create an autorelease pool for you, so to be safe it would be best to create one when using those classes too.The NSOperationQueue handles queuing and executing the operations, so you shouldn’t have to mess with GCD yourself for tasks related to the operation queue.