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
Post a Comment