Hi All,
I am developing an iOS app which is ARC enabled.
When I ran the Instruments tool (Leaks), found that the like containing "imageNamed" method as causing memory leak.
Here is the code snippet.
Similarly this code was also indicating an memory leak.
I read from few links that imageNamed method can cause memory leak issues.
But for some reasons (nearing a major release) I dont want to change imageNamed with imageWithContentsOfFile.
Found another link which says that if you use "strong" (retain's equivalent) will fix this issue.
Need expert's opening on this.
Will changing the property declaration from (nonatomic) to (nonatomic, strong) fix the memory leak issue?
I am developing an iOS app which is ARC enabled.
When I ran the Instruments tool (Leaks), found that the like containing "imageNamed" method as causing memory leak.
Here is the code snippet.
Code:
in .h file
@property (nonatomic) IBOutlet UIImageView *myImg;
in .m
self.myImg.image = [UIImage imageNamed:@"someImage.png"];//causing memory leak
Similarly this code was also indicating an memory leak.
Code:
.h
@property (nonatomic) UIImage *iPanel;
.m
self.iPanel = [[UIImage imageNamed:@"someImage.png"] resizableImageWithCapInsets:edgeInset];
I read from few links that imageNamed method can cause memory leak issues.
But for some reasons (nearing a major release) I dont want to change imageNamed with imageWithContentsOfFile.
Found another link which says that if you use "strong" (retain's equivalent) will fix this issue.
Need expert's opening on this.
Will changing the property declaration from (nonatomic) to (nonatomic, strong) fix the memory leak issue?