摘要:
[UIImage imageNamed:@"icon.png"]用上面的方法加载图片有问题。该方法即可以从bundle中读取图片。这种方法在application bundle的顶层文件夹寻找由供应的名字的图象 。如果找到图片,装载到iPhone系统缓存图象。那意味图片是(理论上)放在内存里作为cache的。因此如果图片资源多了或大了,此方式容易引起发生内存警告从而导致自动退出的问题。最好是通过直接读取文件路径[UIImage imageWithContentsOfFile]解决掉这个问题,应用示例:NSString *path = [[NSBundle mainBundl 阅读全文
随笔档案-2011年10月
警告:Instance method '-renderInContext:' not found的解决办法
2011-10-23 17:40 by 张智清, 2306 阅读, 收藏, 编辑
摘要:
练习PhotoCapture Application in iPhone实践时,碰到renderInContext警告。[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];Xcode4.3弹出警告:Instance method '-renderInContext:' not found解决办法:#import <QuartzCore/QuartzCore.h> 阅读全文