My App need to save some data (around 100 double fields that is stored in array and some few other string data as well). I have a method -(void) case2save already in place to save data to the NSDocumentDirectory when the user initiates it and all is working well, however I need to save the same data when the App is terminated either by the user (home) or by the iOS.
I’m trying to use the applicationDidEnterBackground from the delegate to call that same method i use in the view controller .m class but since the function is per the object (not class method) i can’t, but then if i’m making it to be class method i don’t have the actual data which is part of the object… so that’s the issue.
An idea how to resolve that issue and save the data when App is terminated or goes to the background ?
Thanks.
you can make that function in appdelegate , or just declare a data member of that class in appdelegate.h and make it property and set this data member as self in that function where you are trying to save data , use following…..
Hope this will resolve your issue…