Potential leak of an object XCode

Ads
 

Potential leak of an object XCode

What is potential leak of an object XCode?

View Answers

July 7, 2011 at 4:35 PM

Potential leak - This is a memory leak error that can be detected when you gives the command "Build and Analyze". This checks for all the memory leaks in the application.

And when it throw an error saying "Potential leak of an object" that means you somewhere forget to release it. You can easily fix such kind of error by just releasing/autoreleasing the object that has been alloc in the memory.


July 7, 2011 at 4:39 PM

for example, the given code will throw a memory leak error.

- (NSString *) doIt
{
    NSString *var = [[NSString alloc] init];

    return var;
}

But it can be fixed by releasing the object. See below..

- (NSString *) doIt
{
    NSString *var = [[NSString alloc] init];

   // return var;
   return [var autorelease];

}

Ads









Related Tutorials/Questions & Answers:
Potential leak of an object XCode
Potential leak of an object XCode  What is potential leak of an object XCode
exc_bad_access xcode 4
exc_bad_access xcode 4  How to debug the excbadaccess in xcode 4?   This type of error occurs when there is a memory leak in the application. You can debug it through the breakpoints. Find out if there is any object
Advertisements
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 error. Can anyone explain what type of the "GeneralBlock" error is and when
Creating a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java
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
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
Radiobutton in Xcode
Radiobutton in Xcode  I am new to Xcode .I want to implement Radiobutton in Xcode (using Objective C),and when i select any Radiobutton ,it should remain selected when i open my view next time. Is it possible anyway ? Any advise
xcode web service example
xcode web service example  xcode web service example
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/   
Uninstall Xcode
Uninstall Xcode  Hi, How to uninstall Xcode? Thanks   HI, You can easily unstall Xcode completely from your system. From the command line type: sudo /Developer/Library/uninstall-devtools -mode=all You?ll need
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
xcode 6.1.1 download
xcode 6.1.1 download  Hi, I want to download the Xcode from my windows computer. What is the direct url to download Xcode 6.1.1? Thanks   Hi, Download Xcode 6.1.1. You will still need the Apple user name
upload photo in xcode
upload photo in xcode  how can i upload a photo in a view in xcode? i am a beginner in xcode please help me
ModuleNotFoundError: No module named 'potential-spork'
ModuleNotFoundError: No module named 'potential-spork'  Hi, My... named 'potential-spork' How to remove the ModuleNotFoundError: No module named 'potential-spork' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'unleash_potential'
ModuleNotFoundError: No module named 'unleash_potential'  Hi, My... named 'unleash_potential' How to remove the ModuleNotFoundError: No module named 'unleash_potential' error? Thanks   Hi, In your
xcode warning missing file
xcode warning missing file  on deleting a folder from desktop earlier that has the link to application.. now, stoping the application to run. The xcode is giving warning like file does not exist or xcode warning missing file
semantic issue xcode 4.2
semantic issue xcode 4.2  I have updated xcode 4.0 to 4.2 .. but once i open any application in this new version of xcode ..it throws lots of semantic issue. Can anyone please explain why it occurs and how to resolve
object
object  is it possible to create object in the same class..?.   Yes, you can. class CreateObject { CreateObject(){ System.out.println("I have an object."); } public static void main(String[] args
xcode group folder
xcode group folder  I wanted to show all files in xcode in a group... in Xcode Project Folder. Neelam   Follow the steps.. View -> Smart Groups -> All Files it'll group all the files in Xcode Project Folder. Neelam
application identifier xcode
application identifier xcode  Hi, can anyone tell me what is the profile doesn't match application identifier error in XCode? Thanks
xCode 4 add new framework
xCode 4 add new framework  Hi, How to add new framework in Xcode 4 based application? Thanks
how to enable nszombie in xcode 4
how to enable nszombie in xcode 4  how to enable nszombie in xcode 4
xcode 4 create .ipa
xcode 4 create .ipa   Creating ad hoc for iphone distribution in XCode 4   You can edit scheme and assign different configuration for different actions. Adhoc configuration for archiving for example. Click 'Scheme
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
using xml and html in xcode project
using xml and html in xcode project  i want to use xml file and html in xcode instead of plist how can i do
xcode make phone call
xcode make phone call  xcode make phone call - Our iPhone application required a feature to call over any given mobile or phone number. Just wondering how to enable this feature in my application. Though i have see
ModuleNotFoundError: No module named 'xcode_releasemaker'
ModuleNotFoundError: No module named 'xcode_releasemaker'  Hi, My... named 'xcode_releasemaker' How to remove the ModuleNotFoundError: No module named 'xcode_releasemaker' error? Thanks   Hi, In your

Ads