加载图片我一直在用[UIImage imageNamed:@"test.png"]; 使用也算正常,之后突然常常出现memory warnings问题,了解原理后发现application bundle的顶层文件夹寻找由供应的名字的图象 。 如果找到图片,装载到iPhone系统缓存图象。那意味图片是(理论上)放在内存里作为cache的。

所以加载的图片太多就会这样, 改为 imageWithContentofFile 就解决了,在使用的时候可以灵活运用,各有长处。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
  • 2021-11-22
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-25
  • 2021-10-02
  • 2021-11-21
相关资源
相似解决方案