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 6138393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:51:54+00:00 2026-05-23T17:51:54+00:00

I understand that you generally serialize objects for data persistence using the NSCoder protocol

  • 0

I understand that you generally serialize objects for data persistence using the NSCoder protocol on applicationWillTerminate. Is there any good chance that this serialization will not complete though? I.e. the battery is about to die, so the app quits, and before the serialization can complete, the battery totally runs out.

I’m creating an app where the process for the user to add a new object (like a financial record) is pretty involved. Therefore, a failure to serialize the object would be pretty annoying because the recreation of that object would be a bit time consuming. Should I therefore do the serialization immediately after the user clicks the “Save” button, or can I be certain that the serialization will complete 99.9% of the time on applicationWillTerminate?

On a similar note, if I am having this data synced to a server, will my app have enough time to do this syncing on applicationDidEnterBackground?

  • 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-05-23T17:51:54+00:00Added an answer on May 23, 2026 at 5:51 pm

    For applications that do not opt out of multitasking (by setting UIApplicationExitsOnSuspend to YES in the Info.plist), applicationWillTerminate: will not always be called, you should do your serialization in applicationDidEnterBackground: instead.

    The most significant risk is that your serialization takes too long and the watchdog daemon kills your app before it finishes. This will happen if your serialization is taking more than about 5 seconds, which could very well happen if you serialize large objects.

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

Sidebar

Related Questions

I understand that Null Reference exceptions are always generally vague and any number of
I understand that there are several ways to blend XNA and WPF within the
I understand that after a browser loads jquery, generally it is added to the
Kernel launches in CUDA are generally asynchronous, which (as I understand) means that once
I understand that C++ is generally considered better than Java for games (at least
Informally, most of us understand that there are 'binary' files (object files, images, movies,
I understand that according to Rails philosophy, data integrity checks should be done at
I understand that there's no universal answer to the attribute vs. element debate (and
As I understand it (not that I'm correct) Drawables are generally correctly removed from
Is there any means of reflection in Objective-C that would allow you to write

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.