In some cases, your system may display an error with the uiimageview memory Leak arc. There can be several reasons for this problem.

Hmm. This important fact surprised me a little, because I don’t see any possible leaks in your code. So I did a little test (Xcode 4.3.2, iPhone Simulator 5.1, ARC, Storyboards) to see if I could simulate your problem and run it in Profiler, and no, I found Escape.

  - (void) viewWillAppear: (BOOL) animated    ViewWillAppear: animated]; [super self.label1.text @ "Line means 1";    self.label2.text implies @ "line 2";    NSString * filename = [NSString stringWithFormat: @ "% @ /% @", [[NSBundle resourcePath], mainBundle] @ "IMG_0999.PNG"];    UIImage * image [[UIImage stands for alloc] initWithContentsOfFile: filename];    self.image1.image implies an image; 
  @property Nonatomic) (weak, IBOutlet UILabel * label1;@property Nonatomic) (weak, IBOutlet UILabel * label2;@property Nonatomic) (weak, IBOutlet UIImageView * image1; 

I’m not sure the API isn’t overflowing anymore (I’ve only seen leaks in the Twitter API of course), but I can’t reproduce your problem.

It occurred to me that there is a logical choice (and it will take a while): first, can we try to make something unique in your PNG? Tell me, maybe I can try it in my discovery. Or maybe you can try a few filesin PNG. Or maybe someone can do what I did, which is a very simple project that will try to reproduce the leak and when you run into an awesome problem in your test project. Second, can the leak propagate differently in your code? I already know that these malloc leaks are usually not good for directing you to the correct code, so I was wondering if there is a chance your filter is coming from somewhere else.

Bottom line, I tried to replicate your fit, but I can’t. It appears that further medical diagnosis is needed.

Image file formats are really surprisingly complex, and if you look at the PNG description, you will find a dozen potential areas in which this iOS algorithm might work (either due to a bug in the iOS logic or some that contain problems with the PNG file. ). Of course this shouldn’t leak either, but it is a task that will be to replace as planned by iOS or, in case of failure, dealt with properly. Seems worthy of joining http://bugreport.apple.com. In any case, I would recommendI set out to re-save the PNG file in a layout editor of your choice. The problem can be solved by an external attempt.

Solution

Hmm. I was a little surprised by this guy because I don’t see any potential leaks in your code. So I did a little test (Xcode 4.3.2 rewrite, iPhone 5.1 simulator, ARC, storyboards) to see if I could create your problem and just ran it with a profiler and no, I found a few spots.

uiimageview memory leak arc

  - (void) viewWillAppear: (BOOL) animated    ViewWillAppear: animated]; [super self.label1.text @ "Line means 1";    self.label2.text implies @ "line 2";    NSString * filename = [NSString stringWithFormat: @ "% @ /% @", [[NSBundle resourcePath], mainBundle] @ "IMG_0999.PNG"];    UIImage * image [[UIImage equals alloc] initWithContentsOfFile: filename];    self.image1.image matches the image; 
  @property Nonatomic) (weak, IBOutlet UILabel * label1;@property Nonatomic) (weak, IBOutlet UILabel * label2;@property Nonatomic) (weak, IBOutlet UIImageView * image1; 

I don’t think the API goes beyond drips (for example, I’ve probably seen the Twitter API leaks), but I can’t reproduce your problem.

I noticed that there are several new logical possibilities (and this, of course o, parentheses). First, can your PNG be something unique? Let us know and I can try this in my test. Or you can try the PNG file. Or maybe someone could do the same as me who has a super simple project to try and reproduce the leak and if you have the exact same problem in your test project. Second, could there be a leak somewhere in your code? I know these malloc leaks didn’t help point you to the correct code.

Lower Path, I tried to replicate your illness, but I couldn’t. This appearance may require additional recognition.

uiimageview memory leak arc

Image file formats are usually surprisingly complex, and if you look at the PNG description, you can imagine a dozen potential areas where a particular iOS algorithm might have a filter (either due to a bug in iOS logic alone or an issue in examination, PNG file). Of course, a software leak shouldn’t be happening, but it’s definitely a permutation that iOS may have hoped to handle well. Seems worthy of the context http://bugreport.apple.com. Vanyway, I would suggest opening the PNG file in an image editor of your choice and saving it again. There is potential outside that can fix this.