The error message says:
-[AVCaptureVideoPreviewLayer connection]: unrecognized selector sent to instance
So it's telling you that you can't say connection
to an AVCaptureVideoPreviewLayer.
And indeed, the docs on AVCaptureVideoPreviewLayer say:
connection
Available in iOS 6.0 and later.
So there's the reason: in iOS 5 there's no connection
property of an AVCaptureVideoPreviewLayer.