iPhone camera loses auto-focus when using ZBarSDK

谁说胖子不能爱 提交于 2019-12-03 15:14:56

Before loading up ZBarReaderViewController make sure you release UIImagePickerController, and before you load up UIImagePickerController make sure you release ZBarReaderViewController.

It took me days to figure out why i kept losing the ability to focus, and turns out that i wasn't releasing things. For others stumbling onto this answer... You can only have 1 AVCaptureSession at a time otherwise things get screwy and you lose the ability to focus. ZBarReaderViewController uses AVCaptureSession so make sure you release it before you initialize a new AVCaptureSession.

We were facing same issue with Zbar, we solved it by putting a 2 sec delay before dismissing model view.

I would look deeper into your implementation of taking picture. Try to check if you close the resource correctly when done taking the photo. I don't think zBar implementation got anything to do with it...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!