我正在创建一个简单的GPUImageView。这是我的代码:
GPUImageView *gpImageView = [[GPUImageView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIImage * image = [UIImage imageNamed:@"placeholder.png"];
GPUImagePicture * inputImage = [[GPUImagePicture alloc] initWithImage:image];
[inputImage processImage];
[inputImage addTarget: gpImageView];
[self.view addSubview:gpImageView];
我的应用在这一行崩溃了:
我在iPhone 6+上运行,我的iOS版本是8.3 Xcode版本7.1
我记得在iOS 9.1上运行此代码并且它可以运行。
更新
我刚用模拟器iOS 8.3 iPhone 6测试了它,它可以工作。
答案 0 :(得分:1)
对于iOS 8.3,您可以按照以下方式执行以下操作:
https://github.com/BradLarson/GPUImage/issues/2041
在+ (BOOL)supportsFastTextureUpload
的方法GPUImageContext.m
中执行以下操作:
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
NSString* formattedVersion = [NSString stringWithFormat:@"%.01f", version];
if ([formattedVersion isEqualToString:@"8.3"]) {
return NO; // https://github.com/BradLarson/GPUImage/issues/2041
} else {
return (CVOpenGLESTextureCacheCreate != NULL);
}
希望它会有所帮助:)