Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 14, 2008, 02:31 PM   #1
fenrus110
macrumors regular
 
Join Date: Mar 2008
Is it okay to rely on the didReceiveMemoryWarning function?

My program is like the Page Control sample, except a lot more complicated. So as more and more pages are added, obviously it will run out of memory.

Now I did implement the didReceiveMemoryWarning, and my program doesn't seem to crash no matter how many pages I add.

I'm just wondering if it is okay, (or Apple think it is okay), to be relying on doing this. Should I be releasing the views on the fly instead, so that the didReceiveMemoryWarning never gets close to being called?
fenrus110 is offline   0 Reply With Quote
Old Nov 14, 2008, 10:25 PM   #2
dean1012
macrumors regular
 
Join Date: Jul 2008
Location: Huntsville, TX
Don't hold memory longer than you need to on any device (not even on a computer).

With that said, didReceiveMemoryWarning is a very nice function and you should utilize it. In my app, Nexus Reference, I use it as a method of releasing data from memory that hasn't been viewed in a while.
__________________
Thank You,
Jerry Smith

Facetime / Messages: dean1012@gmail.com
dean1012 is offline   0 Reply With Quote
Old Nov 15, 2008, 03:09 AM   #3
caveman_uk
Guest
 
caveman_uk's Avatar
 
Join Date: Feb 2003
Location: Hitchin, Herts, UK
The iPhone is rather short of memory and it's better to avoid your memory footprint getting large in the first place. Obviously you have to play this against the performance costs of not caching data etc...
caveman_uk is offline   0 Reply With Quote
Old Dec 17, 2008, 01:10 PM   #4
gholias
macrumors newbie
 
Join Date: Dec 2008
Quote:
Originally Posted by fenrus110 View Post
My program is like the Page Control sample, except a lot more complicated. So as more and more pages are added, obviously it will run out of memory.

Now I did implement the didReceiveMemoryWarning, and my program doesn't seem to crash no matter how many pages I add.

I'm just wondering if it is okay, (or Apple think it is okay), to be relying on doing this. Should I be releasing the views on the fly instead, so that the didReceiveMemoryWarning never gets close to being called?

Hey fenrus110

Did you find a solution for this problem? Im having the exactly same issue

any idea about how to avoid the memory leak issuw with the pagecontrol sample?
gholias is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
In which scenario is it convenient to turn on the firewall? doxavita OS X 8 Jan 7, 2011 05:57 PM
Is it okay to update to 10.6.4 with the SL graphics update? Meever OS X 2 Sep 5, 2010 10:47 PM
Will apple read my emails? and is it okay to have porn on the mobileme gallery? AdonisRouse iCloud and Apple Services 13 Jun 6, 2010 10:43 AM
Is it okay to bring a bar of soap on board the plane that looks like you know what? agkm800 Community Discussion 25 Dec 30, 2009 07:39 PM
Is it okay to buy from the Apple Store? Gary King Buying Tips, Advice and Discussion (archive) 11 May 29, 2005 07:43 PM


All times are GMT -5. The time now is 05:09 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC