首页 > 其他 > 详细

UIImageView

时间:2014-09-05 03:22:21      阅读:332      评论:0      收藏:0      [点我收藏+]

 UIImage * image6 = [UIImage imageNamed:@"iphone.png"];

    //使用 imageNamed 创建的对象会在内存中一直存在,空间不会回收,所以当图片子啊程序运行期间频繁使用时,可以选择使用该方法.可以节省堆区空间的开销成本(堆区空间的分配内存的效率明显低于栈区)
    //如果加载过多的图片时,不要使用imageNamed: 会造成内存堆积
    //享元设计模式 (提高程序执行效率)

    
    UIImage * image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"iphone" ofType:@".png"]];
        UIImage * image1 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"iphone" ofType:@".png"]];
        UIImage * image2 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"iphone" ofType:@".png"]];

UIImageView

原文:http://qccccc.blog.51cto.com/6004423/1548911

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!