Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

quick question about forms in a post iphone OS 3.0 world

lmpeejaylmpeejay Posts: 43Registered Users @
This may seem silly, but I am developing my first form heavy app for teh iphone in a very long time.

That having been said, when i was originally developing we had to set up "applicationWillResignActive" to store any form data in case a phone call came in. which is fine, but, I am wondering with apps that can run in the background is it still best practice to set an IBAction so if either the value changes or the form is edited. the updated text is stored in case the phone receives a call?

or does the fact that it is run in the background satisfy the requirement to maintain the form information?

PJ Dahill<br /><br />
<br />
Follow my romp through the world of finding a contract job in this economy on Twitter at "HiTechJobSeeker"


  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,692Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    Running in the background does not mean your app will remain alive the entire time. You seem to be asking if you need to save data, and the answer to that question is a resounding "Yes, of course you need to save data."
    Professional iOS App Development. Available for hire.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn

    BTIKit | SlickShopper 2 | Leave a PayPal donation
  • Duncan CDuncan C Posts: 9,116Tutorial Authors, Registered Users @ @ @ @ @ @ @
    To expand a little on Brian's answer:

    Moving to the background doesn't mean your app continues to run. To the contrary, you get put in suspended animation.

    Once you have gotten a applicationDidEnterBackground message, the system can terminate your app at any time without further notice in order to free up memory for the foreground app, to prepare for shutdown, etc.

    You should always save your app state when you get the applicationDidEnterBackground, and be prepared to reload it if you get launched again.
    Duncan C

    Animated GIF created with Face Dancer, available for free in the app store.

    I'm available for one-on-one help at CodeMentor
  • lmpeejaylmpeejay Posts: 43Registered Users @
    Great thanks...I do save the data, my concern was the opposite of what Brian, so patiently and eloquently suggested. Redundancy. So clarification became king. I went so far as to set up NSUserDefaults to hold the current screen and all it's data on; '...tesignActiive', '...willTerminate' and '...didReceiveMemoryWarning' so i will reload and populate at it's last screen. My concern was redundancy.That having been clarified, what is the best way to test data retention in terminated apps?
    PJ Dahill<br /><br />
    <br />
    Follow my romp through the world of finding a contract job in this economy on Twitter at "HiTechJobSeeker"
Sign In or Register to comment.