Hello all,
I want to know if there is any tutorial provided by apple people or any blog where I can learn how to deal with memory and view releasing when you get didRecieveWarning in iPhone.
Hello all,
I want to know if there is any tutorial provided by apple people or any blog where I can learn how to deal with memory and view releasing when you get didRecieveWarning in iPhone.
I’d definitely read through Apple's Memory Management Programming Guide for Cocoa if you’re new to Cocoa programming and for general memory management topics.
Specific to your question, when you get a didReceiveMemoryWarning
message, you’ll want to release anything that you’re not using. If you have any cached objects or view controllers, release them (just make sure that when they need to be used again they’re reloaded). In general, something that’s expensive to get again, such as resources downloaded from the Internet, should be the last thing that you release so that the user doesn’t have to download it again.
With the advent of -viewDidUnload in 3.0, you should do more of your discarding of objects there. It seems like yet another -dealloc, except that you may want to keep some objects that are expensive to recreate and won't want to release those.