objective c - UIImagePickerControllerCameraDeviceFront only works every other time -


in app i'm attempting use front camera default in uiimagepicker. know, seems simple enough...

imagepicker.cameradevice = uiimagepickercontrollercameradevicefront; 

now, first time launch picker works fine , front camera initialized, when picker dismissed, , presented again camera used. there on out if continuously open , close picker camera used be: front, back, front, back, front, back...

i've stripped code down bare basics of picker attempting isolate problem , persists. has run issue before? pointers or direction appreciated!

edit: problem solved! calling imagepicker = [[uiimagepickercontroller alloc] init]; in viewdidload instead of viewdidappear!

the problem must @ how try initialize/present/dismiss controller.

so, why , forth between cameras?

it seems underlying avcapturesession reason kept running after dismiss of controller. next time presented it, tried add input bussy, went next available (the rear camera), interrupted (thus freeing previous one) , on.


Comments

Popular posts from this blog

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -