ios升级17以后运行闪退。报错日志为*** Assertion failure in void _UIGraphicsBeginImageContextWithOptions(CGSize, BOOL, CGFloat, BOOL)(), UIGraphics.m:410

根据相关断点跟踪,具体报错位置

查看相关api发现iOS17api已经被替代。

替代方式为将UIGraphicsBeginImageContextWithOptions替换为UIGraphicsImageRenderer。

UIGraphicsImageRenderer的初始化方式为:

    UIGraphicsImageRenderer *re = [[UIGraphicsImageRenderer alloc] initWithSize:TOP_VIEW.bounds.size];

 

再次运行程序正常启动。

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐