renderInContext taxes App Memory

强颜欢笑 提交于 2019-12-05 14:49:15

The memory jumps because the image is huge - if you are sure that you won't need it anymore, you should wrap wherever you are using the returned image in an autorelease block:

e.g.

@autoreleasepool {
    UIImage *theReturnedImage = yourmethodthatreturnstherenderedimage();
    // do stuff with your image
}

Unfortunately, until you are finished using the image, it will take up space, so you just have to release it quickly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!