Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8136439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:45:35+00:00 2026-06-06T10:45:35+00:00

My App need to save some data (around 100 double fields that is stored

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:45:37+00:00Added an answer on June 6, 2026 at 10:45 am

    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…..

    //in Your Appdelegate.h suppose you have viewController named AbcViewController ....
    AbcViewController  *abcVC;
    
    create property ...
    @property (nonatomic,retain) AbcViewController  *abcVC;
    
    //in Your Appdelegate.m
    @synthesize  abcVC;
    
    //Now in function where you are trying to save database .....
    
    AppdelegateClass   *app = (AppdelegateClass*)[[UIApplication sharedApplication]delegate];
     app.abcVC = self;
    
     //now call that function from applicationDidEnterBackground with the help of this object...
    

    Hope this will resolve your issue…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my app i need to save some data. Right now i use CoreData,
I'm making an android app, and I need to save the double value(BodySize) to
im building an android app and i need to save some files locally on
I'm trying to catch WM_QUERYENDSESSION to save some data in the app, but it
I got ios app. I need to store some data. I tried to do
I develop an app which collects some data from internet. Then save it to
I am making unittests for a django app. I need some data in the
In my app I sometimes need to import some CSV data and I wanna
I am working on an app where I need to save a part of
I need to save objects - instances of classes - in my app like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.