开发者

UIImage or CGImage is preferred?

开发者 https://www.devze.com 2023-01-22 16:43 出处:网络
I have a UIView with UIImageView as its subview and i need to change the image in that view while the user开发者_开发百科 swipe it.

I have a UIView with UIImageView as its subview and i need to change the image in that view while the user开发者_开发百科 swipe it.

I tried it using UIImage, but the app crashes and the memory keeps on rising.

When I tried some googling I got to know that CGImage might be a good choice. Can someone direct me to the right track.

Thanks


UIImageView works with UIImages. CGImage is a representation of more low-level image data.

You want to keep using UIImage and concentrate on fixing your bugs. Apparently you are not properly handling memory - retaining and releasing images. Use debugger to fix the crash, Instruments to figure out why memory consumption goes up. I answered another question with information how it can be solved: UITextView delegates problem


Try loading UIImage to UIImageView by tiling

0

精彩评论

暂无评论...
验证码 换一张
取 消