iphone memory management

iphone memory management

I am confused with the memory management issue in iPhone. I do not know which variable need to release?

View Answers

July 27, 2011 at 4:27 PM

I guess you need to release variables only which you assign using alloc.

For eg:

// string1 will be released automatically
NSString* string1 = [NSString string];

// must release this when done
NSString* string2 = [[NSString alloc] init];
[string2 release];

Hope it helps,

-Dinny









Related Tutorials/Questions & Answers:
iphone memory management
iphone memory management  I am confused with the memory management issue in iPhone. I do not know which variable need to release
Memory Management
Memory Management  how can we manage memory in iphone development???   hello, you can read all the memory management rules from ADS_TO_REPLACE_1 http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual
Advertisements
memory management
memory management  memory management in java
memory management
memory management  Why objects store in heap
memory
memory  what is memory
Memory
Memory   what is the different between heap memory and stack memory ? please explain with example
memory
memory   hi i am jane pls explain the difference between heap memory and stack memory
iphone
iphone  hiii, how can we use table recursively in iphone
iphone
iphone  hello... i want to make first iphone application . How can i make it plz help me
iphone
iphone  How can connect with the other database in iphone application(like... MYsql or oracle) is this dirctly possible
NSZombieEnabled iPhone
NSZombieEnabled iPhone  NSZombieEnabled Trouble in setting How can i set the NSZombieEnabled in iPhone application to track unmanaged memory
Sitemap iPhone Tutorial
Inheritance | Dynamic Types in Objective-C | Objective-c memory management... iPhone | Objective C Tutorial | Objective C Introduction | Why... C on Mac | Compiling Objective C | iPhone Application Development
iphone
improves   the   code  management.   All  screens  must  comply  to
iphone - EXC_BAD_ACCESS
, this types of error occurs when memory management is not done properly...iphone - EXC_BAD_ACCESS  What cause this "iphone - EXCBADACCESS... and allocation is given for it. But somehow you forget to release it's object from memory
Objective-c memory management: retain and release
Objective-c memory management: retain and release... the Foundation framework deals with memory management when you create classes... how to manage memory with language Objective-C. Programmer can allocate memory
Hire iPhone developer
Testing, Memory Management, accelerometer, XML Parsing, Threading, Webkit...Hire iPhone developer - Hire iPhone developers in India Apple?s iPhone is superior to all smart phones but developing applications for iPhone is not an easy
iPhone News
at typical Apple idiosyncrasies such as the lack of extendable memory on their iPhone... iPhone News and Updates       iPhone is a multi-touch smartphone launched by Apple Inc
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
Finally Apple Unlocks the Bluetooth Features on iPhone
such as the lack of extendable memory on their iPhone or the missing measly floppy drive on the iMac. While the iPhone is simply a great gadget it lacked certain basic... Finally Apple Unlocks the Bluetooth Features on iPhone
Phantom memory
Phantom memory  hello,, What is phantom memory
Phantom memory
Phantom memory  What is phantom memory
Memory - Java Beginners
Memory management in Java  Where are these Heap and Stack? Is there size fixed? what is core area in memory
Management
Management  Hi, Can anyone give me full details of Management? Thanks   Hi, Please see the thread What is management? Thanks
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
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
heap memory
heap memory  how long is the object stored in heap memory persist
iPhone Graphics
iPhone Graphics  Hi, How to create iPhone Graphics? I am learning to crate UI Design for iPhone and iPad. Thanks
iphone avfoundation
iphone avfoundation  What is iphone avfoundation and why it is required? Can anyone show how to implement the AVFoundation in iPhone application with example or tutorial? Thanks
Iphone call
Iphone call  Do you have other method to make a call on Iphone,without openUrl
Iphone Tutorial
Iphone Tutorial  Hi, I am a new in this mobile applications segment. From where i will get the information about iphone tutorial or Iphone Development Tutorials. Please suggest the resouces......... Thanks
Clear UIWebView cache iPhone
Clear UIWebView cache iPhone  Hi, In my iPhone application ..i am using a UIWebView to load different URL on it. But i am afraid that it 's not releasing the memory. Can anyone please explain me how to load and release
Java memory leak
Java memory leak  What is memory leak
iPhone
iPhone       Apple iPhone 3G is a multi-touch smartphone that has successfully combined multimedia, email, business and internet into a single platform. The iPhone
remove from superview iphone sdk
remove from superview iphone sdk  How to remove the old view from super-view and add the new view safely? My main concern is memory leak.. so, please suggest how can i do it without facing a memory leak. Thanks
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
What is iPhone SDK?
What is iPhone SDK?       What is iPhone SDK? The iPhone SDK or iPhone software... and build the software for the iPhone. The iPhone SDK includes the API and components
Offshore iPhone Development
Offshore iPhone Development With the evolution of Apple's iPhone (internet... marketing owner of iPhone - has first time introduced unique integrated features... application software for iPhone and stored on iTune - Apple's multimedia
32 GB iPhone Coming in June
New iPhone Version to be Launched in June According to reliable sources the new iPhone with 32 GB memory is expected to hit the stores in June. The new... was still stuck at 16 GB without any external memory option, for the iPhone
iPhone resignfirstresponder
iPhone resignfirstresponder  Hi, Provide me a good example of iPhone resignfirstresponder. I need a code to hide keyboard when use clicks outside the text box. ThanksADS_TO_REPLACE_1   Hi, You can use the following
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
Creating a memory leak with Java
Creating a memory leak with Java  Creating a memory leak with Java
iPhone 3GS Programming
memory in iPhone 3G. ADS_TO_REPLACE_1 The Apple's iPhone... iPhone 3GS Programming iPhone 3GS is the advanced version of iPhone 3G, which Apple inc had released in 2007. With the launch
iPhone Software Development
iPhone Software Development Apple's Inc. iPhone is an amazing device used... iPhone in the downgraded version of OS framework to Mac OS X framework. It has.... Developing software for iPhone is hard nut to crack and earlier only Apple Inc
Web Development for iPhone
. Moreover the memory of iPhone is also not so high as desktop’s memory, so... Web Development for iPhone Developing Web apps for iPhone or any other... for desktop. A web app for iPhone needs special characteristics and developers must
iPhone 3G FAQ
in-built memory. What about iPhone software upgrades? ADS_TO_REPLACE_10... iPhone 3G FAQ       If you are looking for answers to all your iPhone queries and doubts, look
Iphone Developmnt
Iphone Developmnt  i am making an application in ios, for ipad or iphone, what i want to know is that can i provide an option of changing the theme , or can i separate my code from the theme... so that when giving my product
iPhone php session
code for session management in iPhone application backed with PHP server code...iPhone php session  Hi, I am developing an application for iPhone. In my application user validated with a php file on server. Now I don't know how
iphone nsurlrequest authentication
iphone nsurlrequest authentication   How to authenticate a form in iPhone Application
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
Outsourcing iPhone development
, Core Service, iPhone Content Management services, iPhone graphics, GPS...Outsourcing iPhone Development Apple Inc., which is the habitual... the world by launching third generation Internet phone – iPhone. After its

Ads