TestFlight下载App,加载图片失效。Xcode安装App,图片加载正常。
热烈欢迎,请直接点击!!!
进入博主App Store主页,下载使用各个作品!!!
注:博主将坚持每月上线一个新app!!
图片在Assets.xcassets中,
UIImage *image = [UIImage imageNamed:@"图片名称"]; [[UIImageView alloc] initWithImage:image]; UIImageView *test = [[UIImageView alloc]init]; [test setImage: image];
以上方法从TestFlight下载测试App,加载图片失效。
思考:
TestFlight下载的App,是Release模式下,加载图片失效,
Xcode安装App,是Debug模式下,图片加载正常。
修复方法:
【项目Targe】-【Build Settings】-【Swift Compiler-Code Generation】-【Optimization Level】-【Release模式】修改为【No Optimization[-Onone]】

修复方法二:
请参看我以前发的文章:
获取Assets文件,把不显示的图片添加到工程中。