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

ilx.mac

macrumors member
Original poster
Mar 10, 2009
63
0
Hi there,

I need to handle interrupt from my application. But i am not aware of that. While googling I found that, I need to save the state in applicationwillresign and reload the state in didbecomeactive. but I am not sure how to do that. I havent seen any code samples. Can you help me on this by providing some tips & code samples.


Thanks in advance!:)
 
How you do this will depend entirely on your model layer. You should save this out along with enough additional data to reset your view state to the same as when interrupted.

The collection classes all supply writeToFile: methods (and similar read methods). Personally I'd be using that unless you have large amounts of binary data...
 
Thanks for your quick reply.

For example, I have 10 rows displaying phone number in a tableview. And my file name is contactview. In viewdidload of contact view i am parsing an xml data & displaying it in the table view.

While a phone no is selected, I am making a call from my application.

Now what are the things, I need to store in a file?
Also how to use the willresignactive & becomeactive methods?
Do I need to use notifications?
If yes can you tell me how to set values for notifications?

Since this is my first app, i am not aware of what to do. Can you help me on this please?


Thanks again!:)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.