swift - Getting EXC_BAD_ACESS code =1 When Trying To Capture An Image From Camera -



swift - Getting EXC_BAD_ACESS code =1 When Trying To Capture An Image From Camera -

new issue has come i've moved swift. code worked in objc broken.

func captureimage() { var videoconnection:avcaptureconnection = avcaptureconnection() connection in _stillimageoutput.connections { } }

for reason, if run above loop exc_bad_access code 1 on lastly line.

_stillimageoutput avcapturestillimage object , not nil

commenting out var videoconnection:avcaptureconnection = avcaptureconnection() stops crash.

any ideas?

turns out had nil loop

doing var videoconnection:avcaptureconnection = avcaptureconnection() caused crash.

changing var videoconnection:avcaptureconnection! fixed issue

swift ios8 avfoundation avcapturesession avcapturedevice

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -