Instance Method


Creates a command buffer that doesn't hold strong references to any objects required to execute the command buffer.



- (id<MTLCommandBuffer>)commandBufferWithUnretainedReferences;

Return Value

A command buffer object that doesn't hold a reference to any objects.


The commandBuffer method generates command buffers that maintain references to objects used when the buffer is executed; this guarantees that the objects are there when the buffer is executed. Use this method to generate command buffers only in extremely performance-critical applications where the cost of adding and removing strong references to objects is significant. If you do use this method, you must guarantee that your app keeps strong references to all objects referenced by the command buffer until its commands have finished executing. If an object is released before the buffer's commands are executed, the results are undefined.

This method sets the retainedReferences property of the returned command buffer to NO.

See Also

Creating Command Buffers

- commandBuffer

Creates a command buffer.