| Originator: | sebastian.varela | ||
| Number: | rdar://16258646 | Date Originated: | |
| Status: | Resolved: | ||
| Product: | iOS SDK | Product Version: | |
| Classification: | Reproducible: |
Summary: I am experiencing an issue that might be a bug, since it is not documented and it is not consistent throughout different iOS versions. In iOS 7.0.5 (iPhone 5C, iPad 3 and iPad mini tested) and iOS 6.1.3 (iPhone 4, iPad2 and iPad mini tested), when I'm running my app and I long-press the lock button, forcing the system to prompt me to shut down the device and eventually sliding for shutting down, the "applicationDidEnterBackground:" method of my AppDelegate is never invoked. This is the behavior I've tracked: // lock button long-press 2014-03-07 08:47:13.200 BackgroundTest[598:907] applicationWillResignActive: // slide right to power off device 2014-03-07 08:47:15.263 BackgroundTest[598:907] applicationWillTerminate: From the documentation, I'd expect the method "applicationDidEnterBackground:" to run at some point (at least, just before the "applicationWillTerminate:"), but this never happens. What is even more weird is that in iOS 5 (5.1.1 - iPad 1) running exactly the same app the sequence of method calls is as follows: // lock button long-press 2014-03-07 08:47:15.263 BackgroundTest[1739:707] applicationWillResignActive: // slide right to power off device 2014-03-07 08:47:17.317 BackgroundTest[1739:707] applicationDidEnterBackground: 2014-03-07 08:47:17.383 BackgroundTest[1739:707] applicationWillTerminate: According to the "applicationDidEnterBackground" method description in the official documentation, "You should use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later". So I'm saving my app's important user data in this method and, consequently, losing it in the scenario described above (the user powering off the device while using my app). Applications expect to go into the background in good order. Many applications do important things in applicationDidEnterBackground:, like saving data. Steps to Reproduce: Expected Results: Actual Results: Version: iOS 7.0.6 (11B651) iOS 6.1.3 (10B329) Notes: Configuration: Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!