UIImage imagenamed memory leak

UIImage imagenamed memory leak

Hi,

Following code is creating memory leak:

UIImage * img1 = [UIImage imageNamed:@"myimage.png"];

I have to replace existing image with new image.

What could be the possible solution?

Thanks

View Answers

February 2, 2011 at 8:30 PM

Hi,

In my application i crated 4 UIImageview in .xib file and then hide and displayed the image using following code:

myButton.hidden=YES; //for hiding

and

myButton.hidden=NO; //for displaying

Thanks

Ads









Related Tutorials/Questions & Answers:
UIImage imagenamed memory leak
UIImage imagenamed memory leak  Hi, Following code is creating memory leak: UIImage * img1 = [UIImage imageNamed:@"myimage.png"]; I have to replace existing image with new image. What could be the possible solution? Thanks
Creating a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java
Advertisements
Java memory leak
Java memory leak  What is memory leak
NSMutablestring memory leak
NSMutablestring memory leak  Why i am getting the nsmutablestring memory leak "NSCFString" leak
Memory leak in While loop
Memory leak in While loop  How to manage a memory leak in While loop ?   make sure loop is not running infinitley. ------------------------------------ Chandraprakash Sarathe http://javaved.blogspot.com/   
GeneralBlock Memory Leak
GeneralBlock Memory Leak   Hi all, I'm testing my iPhone application using instrument test in XCode 4... but on every test it throws a GeneralBlock... to debug this kind of memory leaks in iPhone instrument test
solutions for memory leak of dicom images when using ImageIO library.
solutions for memory leak of dicom images when using ImageIO library.   I am utilizing ImageIO.write(). Out of memory error. please don't recommend System.gc(); for optimizing the memory usage
UIImage from file
provide me code for uiimage from file. Thanks   HI, You can use following code: myImageView.image = [ UIImage imageNamed:@"image.png" ]; Thanks...UIImage from file  Hi, I have added an png image to my project. Now
uiimage initwithdata example
uiimage initwithdata example  I need uiimage initwithdata example UIImage *img = [[UIImage alloc] initWithData:data
How to add UIImage on pin location MKMapKit
;pinannotation.image = [ UIImage imageNamed:@"image.png...How to add UIImage on pin location MKMapKit  Hi, In my application, i need to add a custom image on MapView controller instead of pin. I am calling
Memory
Memory   what is the different between heap memory and stack memory ? please explain with example
Load UIImage from URL
Load UIImage from URL  Load UIImage from URL
memory
memory   hi i am jane pls explain the difference between heap memory and stack memory
memory allocation
memory allocation  If we assign memory malloc(5) and access more than the assigned memory then what will happen? 1.segmentation error 2.memory leak 3.program will not compile 4.Your view
Potential leak of an object XCode
Potential leak of an object XCode  What is potential leak of an object XCode
UIImage width and height
UIImage width and height  Hi, How I can find the width and height of UIImage object. Let's know an example code for finding UIImage width and height. Thanks
ModuleNotFoundError: No module named 'leak'
ModuleNotFoundError: No module named 'leak'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'leak' How to remove the ModuleNotFoundError: No module named 'leak' error
ModuleNotFoundError: No module named 'leak'
ModuleNotFoundError: No module named 'leak'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'leak' How to remove the ModuleNotFoundError: No module named 'leak' error
java connection leak
java connection leak  How to check the connection leak in Java
Objective C resize UIImage
Objective C resize UIImage  i just want to resize the image on the touch detection. That means if a user double clicks on the UIImage it must resize the image
save uiimage to photo library
save uiimage to photo library  How to saved the clicked picture...; Save UIImage to photo library Creating a camera application in iPhone need... image from info dictionary UIImage *image = [info objectForKey
memory management
memory management  memory management in java
[UIImage isKindOfClass:]: message sent to deallocated instance
[UIImage isKindOfClass:]: message sent to deallocated instance  Hi, I am getting following error: -[UIImage isKindOfClass:]: message sent to deallocated instance How to resolve the issue? Thanks
ModuleNotFoundError: No module named 'nose-leak-detector'
ModuleNotFoundError: No module named 'nose-leak-detector'  Hi, My... named 'nose-leak-detector' How to remove the ModuleNotFoundError: No module named 'nose-leak-detector' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'nose-leak-detector'
ModuleNotFoundError: No module named 'nose-leak-detector'  Hi, My... named 'nose-leak-detector' How to remove the ModuleNotFoundError: No module named 'nose-leak-detector' error? Thanks   Hi, In your
memory management
memory management  Why objects store in heap
memory layout
memory layout  how much space does each segement(data,stack,heap,static) holds in memory? memory here refers to ram or hard disk
heap memory
heap memory  how long is the object stored in heap memory persist
Memory Allocation
Memory Allocation  What Is The Order Of Execution Of Statement 1) Statement Enclosed in {}. 2) Static 3) Public Static Void Main()   When jvm loads a class, static block is executed first, then main method. And at last
memory allocation
memory allocation   class Bird { { System.out.print("b1 "); } public Bird() { System.out.print("b2 "); } } class Raptor extends Bird { static... of execution of statement ? memory allocation ?  The code uses static
heap and stack memory
the difference between heap memory and stack memory   STACK memory is referred as temporary memory,if you come out of the program the memory of the variable will not no more there.[eg., int a; memory for a will not maintained

Ads