On iOS app, I press the home button twice to display the multi-tasking bar, swipe up the app, and exit. Is this equivalent to the Not Running state in iOS app's lifecycle?
With the app I'm making now, starting the app after starting the actual iOS device (this is definitely starting from NotRunning state), and ending it from the multi-tasking bar and starting it again as above are different.
I think it's just a lack of knowledge, but please let me know.
What exactly are the different movements?
→ I try to save the screen I was working on before I finished and restore it when I resume, but when I restart from the exit from the multi-task bar, it doesn't restore and the first screen appears.
If you are using the save/restore app state feature enabled by -application:shouldSaveApplicationState:, etc., then the save state from the multi-tasking bar seems to be destroyed by forced shutdown of the multi-tasking bar:
→ We were doing exactly what you pointed out.
I understand that it is a specification, thank you.
Considering the question, both end up in Not Running state, but …
User-operated termination is the same as terminating a suspended app:
→ As a result, I am sorry that the question was different from the problem with my application this time.
I understood one thing as a life cycle knowledge.
I can't duplicate the image of the Apple document, so I summarized the running status of the application below.
application:willFinishLaunchingWithOptions
/application:didFinishLaunchingWithOptions
applicationDidBecomeActive
applicationDidEnterBackground
applicationWillResignActive
/applicationWillEnterForeground
applicationWillTerminate
application:willFinishLaunchingWithOptions
/application:didFinishLaunchingWithOptions
applicationDidBecomeActive
applicationDidEnterBackground
applicationWillResignActive
/applicationWillEnterForeground
applicationWillTerminate
When considering the question, both end up in the Not Running state, but the method called in the state transition at Terminate is different. The following (3.) is considered to be the behavior of the problem.
The presence or absence of notification by applicationWillTerminate
depends on whether the application is in Suspended state at exit. If you send an application to the background, applicationDidEnterBackground
is likely to be the last time you can finish the application, so you should save the operation screen at that time or at applicationWillResignActive
.
User-operated termination is the same as terminating a suspended app:
User-initiated termination has the same effect as terminating a suspended app.
The next state of Suspended is Not running (Execution States for Apps), so you can think of booting from the multitasking bar as starting from the Not running state.
If you are using the Save/Restore App State feature, which is enabled by -application:shouldSaveApplicationState:
, etc., it seems to be a safety specification that the saved state is destroyed by forced termination from the multitasking bar:
Deleting the reserved state information when the app is killed is a safety precaution.
Tips for Saving and Restoring State Information
578 Understanding How to Configure Google API Key
914 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.