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

  • SEARCH
  • Home
  • 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 8054233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:06:10+00:00 2026-06-05T08:06:10+00:00

I have an app that syncs records created on the phone with a web-server.

  • 0

I have an app that syncs records created on the phone with a web-server.

When app does not have internet connectivity, it store everything locally (Core Data) and then syncs it when internet is available again.

Now a user has come up with a valid user case scenario … say he is in an airplane making records (without network) … so everything is getting stored locally. All is well till the air hostess commands him to switch off the phone. While in the app he immediately turns if off. Now the data is getting lost. I am saving sate while app goes in background or even when phone is locked. But how do I warrant for this?

When user switches off the phone (long-pressing lock button), they still have to slide a bar and devices takes some time before switching off … so there is some time I can save state in … which delegate method is called during this time?

  • 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-05T08:06:10+00:00Added an answer on June 5, 2026 at 8:06 am

    Your app will get applicationWillResignActive, applicationDidEnterBackground, applicationWillTerminate calls, in that order.

    http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html#//apple_ref/doc/uid/TP40007072-CH4-SW3

    You can use applicationWillTerminate as a cue to save stuff.

    However it is standard good practice to make sure your data is saved periodically as you go along and not just in these situations – what about if your user has entered lots of lots and data and then your app crashes, the data will be lost.

    I’m not very familiar with Core Data but surely it must have atomic save ability.

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

Sidebar

Related Questions

I have android app that talks to server and syncs some data int SQLite
I have a rails CMS app that manages content for a production web server
I have an app that I want to use to store different people's data.
I have an app that calls to a server and gets a long string
I currently have an iPhone app in the iTunes app store that uses a
I have written a C++ app that sync's Outlook emails with our central server
I have an app that syncs data from a remote DB that users populate.
i have an iphone app that uses coredata to store its contents. users often
I'm in the progress of building an web-app that syncs with an iOS client.
I have written a small util in an app that syncs the time from

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.