//截图 再读取

        UIGraphicsBeginImageContextWithOptions(currentImageView.bounds.size, YES, 0);//currentImageView 图片VIEW

        

        CGContextRef context = UIGraphicsGetCurrentContext();

        [self.layer renderInContext:context];

        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

        UIGraphicsEndImageContext();

        //识别二维码

        CIImage *ciImage = [[CIImage alloc] initWithCGImage:image.CGImage options:nil];

        CIContext *ciContext = [CIContext contextWithOptions:@{kCIContextUseSoftwareRenderer : @(YES)}]; // 软件渲染

        CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:ciContext options:@{CIDetectorAccuracy : CIDetectorAccuracyHigh}];// 二维码识别

        NSArray *features = [detector featuresInImage:ciImage];//手机连接Xcode运行到这就出问题 但是在手机上 运行没问题

        for (CIQRCodeFeature *feature in features) {

            NSLog(@"msg = %@",feature.messageString); // 打印二维码中的信息

            //对结果进行处理

}