NSBlockOperation and NSAutoreleasePool

Typically, when you create an NSOperation subclass, you are responsible for creating and releasing NSAutoreleasePool in the -main method.

When you use NSBlockOperation , do you need to create an autoplay pool in a block?

+4
source share
3 answers

No. The GCD (which NSOperationQueue builds on top of OS X 10.6 or iOS 4.2) manages autoplay pools for you, just like NSRunLoop does.

+4
source

I don’t think so, since work queues have their own pools already created for you.

0
source

Adam,

It is best to read block memory information with objects. Here is a link to iOS Blocks and Variables at the bottom of this page contains information about the types of objects.

Franc

0
source

Source: https://habr.com/ru/post/1341164/


All Articles