1

我正在使用 AVCaptureSession 捕获视频,并且在 iOS 6.1 上一切正常。但是,我一直在尝试从另一个线程检查我的捕获会话是否正在通过 isRunning 方法运行。但是,无论我的捕获会话是否正在运行,该方法都会返回 NO。

但是,如果我在主线程上调用 isRunning 方法;我得到了正确的值。

有人对此有很好的解释吗?

4

1 回答 1

0

My bad. It turns out that the way I was accessing my capture session was not thread safe. Also it is worth pointing out that running( with "isRunning" method as a getter) is a non-atomic property, which does not help with the whole problem either.

于 2013-02-13T22:32:11.247 回答