Wait for all Operations in queue to finish before performing task

前端 未结 6 1905
小鲜肉
小鲜肉 2021-01-02 07:29

I have an Operation subclass and Operation queue with maxConcurrentOperationCount = 1.

This performs my operations in a sequential order that i add them which is goo

6条回答
  •  臣服心动
    2021-01-02 07:39

    Set the maximum number of concurrent operations to 1

    operationQueue.maxConcurrentOperationCount = 1
    

    then each operation will be executed in order (as if each was dependent on the previous one) and your completion operation will execute at the end.

提交回复
热议问题