Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sandhya.rai

macrumors newbie
Original poster
Jan 12, 2009
26
0
Hi All ,


I want to know how to save the state of application while
calling from application .How the state of an application
can be saved while calling from iphone application.


Thanks in advance
sandhya
 
there is no one single instruction and no universal recipe for that. it greatly depends on the state of each application. typically i make sure that each object i create is serializable, and when the time comes i use the NSKeyedArchiver on them. restoring is a bitch - you have to rebuild the views and view controllers structure, just like the user navigated to the point it was interrupted. it's a good practice to do that when you need to have the app start from where it was shut down last time, for whatever reason, including initiating a call from the app.

this being said, i think when you receive a phone call you dont have to go thru all that pain. somebody correct me if i'm wrong, but i remember a phone call only suspends the execution of your application, leaving it in memory, and resumes the app when the call is done. this would probably screw up timers if you have any, but generally you should be safe.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.