Equivalent of GCD serial dispatch queue in iOS 3.x

后端 未结 5 705
日久生厌
日久生厌 2021-01-02 04:52

Apple\'s Grand Central Dispatch (GCD) is great, but only works on iOS 4.0 or greater. Apple\'s documentation says, \"[A] serialized operation queue does not offer quite the

5条回答
  •  无人及你
    2021-01-02 05:12

    If the processing is in the background anyway, do you really need it to be strictly in-order? If you do, you can achieve the same effect simply by setting up your dependencies so 1 depends on 0, 2 on 1, 3 on 2, etc. The operation queue is then forced to handle them in order. Set the maximum concurrent operation count to 1, and the queue is also guaranteed to be serial.

提交回复
热议问题