UIImageView/UIImage “Memory Tag 70” release timing when scrolling

前端 未结 3 384
谎友^
谎友^ 2021-01-01 07:58

I have a long horizontal paged scrollview, for each page, I put a fullscreen UIImage.

As it is expensive and not necessary to add all UIImage at once, currently I la

3条回答
  •  不知归路
    2021-01-01 08:10

    I would try the following:

    1. Don't use [UIImage imageNamed:] for loading images. That builds up in memory tag 70.
    2. Use the instance methods initWithContentsOfFile: and autorelease it explicitly. Note: Doing so would mean losing the caching advantage [UIImage imageNamed:] gives. But try it out.
    3. Use @autoreleasepool (instead of NSAutoreleasePool) around the code where image allocation happens. It can be used regardless of ARC.

提交回复
热议问题