[Objective-C] ios获取图片的方法代码 →→→→→进入此内容的聊天室

来自 , 2021-02-14, 写在 Objective-C, 查看 119 次.
URL http://www.code666.cn/view/581b41df
  1. 建议使用该方法获取图片
  2. NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"sun"  ofType:@"png"];
  3. UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagePath];
  4.  
  5. 不要使用下面的方法,图片过大容易造成内存溢出
  6. UIImage *image = [UIImage imageNamed:@"sun.png"];
  7. //objectc/5586

回复 "ios获取图片的方法代码"

这儿你可以回复上面这条便签

captcha