Этот метод возвращает qr кодовое изображение строки. Он работает правильно на Ios 12.0.1 (iphone SE), но на 12.4.2 (iphone 6) происходит сбой. Сбой метода, когда я пытаюсь назначить результирующее UIImage
для UIImageView
, результирующее UIImage
не равно nil.
-(UIImage*)get_QR_image :(NSString*)qrString :(UIColor*)ForeGroundCol :(UIColor*)BackGroundCol{
NSData *stringData = [qrString dataUsingEncoding: NSUTF8StringEncoding];
CIFilter *qrFilter = [CIFilter filterWithName:@"CIQRCodeGenerator"];
[qrFilter setValue:stringData forKey:@"inputMessage"];
[qrFilter setValue:@"H" forKey:@"inputCorrectionLevel"];
CIImage *qrImage = qrFilter.outputImage;
float scaleX = 320;
float scaleY = 320;
CIColor *iForegroundColor = [CIColor colorWithCGColor:[ForeGroundCol CGColor]];
CIColor *iBackgroundColor = [CIColor colorWithCGColor:[BackGroundCol CGColor]];
CIFilter * filterColor = [CIFilter filterWithName:@"CIFalseColor" keysAndValues:@"inputImage", qrImage, @"inputColor0", iForegroundColor, @"inputColor1", iBackgroundColor, nil];
CIImage *filtered_image = [filterColor valueForKey:@"outputImage"];
filtered_image = [filtered_image imageByApplyingTransform:CGAffineTransformMakeScale(scaleX, scaleY)];
UIImage *result_image = [UIImage imageWithCIImage:filtered_image
scale:[UIScreen mainScreen].scale
orientation:UIImageOrientationUp];
return result_image;
}
строка, участвующая в сбое:
filtered_image = [filtered_image imageByApplyingTransform:CGAffineTransformMakeScale(scaleX, scaleY)];
создает этот журнал:
warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available.
В моем методе есть что-то, что работает только на 12.0.1? Или может что-то не так? Как я могу исследовать больше, чтобы решить эту аварию?
РЕДАКТИРОВАТЬ
в красном, у меня есть:
MyQrCodeImageViewBig.image=qrimage;
с сообщением:
Thread 1: EXC_BREAKPOINT (code=1, subcode=0x1a83e146c)