Memory leak for UIImageView?

2019-03-05 05:03发布

问题:

I did the the following steps:

  1. Create a view-based iPad application in Xcode,
  2. Open the .xib file, add an UIImageView, set an image for it(a 200x100 image).
  3. Launch the program by Run>Run with performance tool>Leak

And there are two leaks reported:

Leaked Object  #   Address Size    Responsible Library Responsible Frame
Malloc 128 Bytes        0x72186d0   128 ImageIO BuildPluginListPurple
Malloc 128 Bytes        0x4712000   128 CoreGraphics open_handle_to_dylib_path

So....What is happening?

Thanks

回答1:

If you are testing in the simulator, you should try running the same test on an actual iPad. Odds are that you won't see the leak there.