What does DispatchQueue.AutoreleaseFrequency.workItem mean?

The documentation for DispatchQueue.AutoreleaseFrequency.workItem says , "The queue configures an autorelease pool before the execution of a block, and releases the objects in that pool after the block finishes executing."

Does this mean that the dispatch queue releases each work item or each code in ()->Void after each one finishes executing? When it says, "releases the objects in that pool er the block finishes executing", it makes it sound like there is only one block executing and then the entire pool is released. I'm making sure I verify that I understand this correctly.

You seem to have misunderstood something critical here, namely the relationship between work items (blocks run on a queue) and objects that are placed in the autorelease pool. This is hard to explain without a bunch of historical background, so I wrote Objective-C Memory Management for Swift Programmers.

Please read that through and, if you still have questions, post them here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

What does DispatchQueue.AutoreleaseFrequency.workItem mean?
 
 
Q