In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to achieve iOS application exit scenario, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to understand it.
Scenario description: when the application is running (that is, the Active state), select the home key or another application interrupts the current application.
The state transition process of this scenario can be divided into two situations: it can be run or suspended in the background, and it cannot be run or suspended in the background. These two states can be controlled according to whether the relevant attribute Applicationdoesnotruninbackground (shown in figure 2-21) in the product properties file (such as HelloWorld-Info.plist) is or not. If you open the HelloWorld-Info.plist file with a text editor, the key for this setting item is UIApplicationExitsOnSuspend.
1. UIApplicationExitsOnSuscards key setting:
Applications can be run or suspended in the background. The state transition process of this scenario is shown in figure 2-22. It goes through three stages and four states: Active →.
Inactive → Background → Suspended
1. In the Active → Inactive stage. Call applicationWillResignActive: method, issue
UIApplicationWillResignActiveNotification Notification
2. In the Inactive → Background stage. The application goes from the inactive state to the background (does not involve the methods and notifications we want to focus on)
3. In the Background → Suspended stage. Call applicationDidEnterBackground: method, issue
UIApplicationDidEnterBackgroundNotification Notification
2. Click the Home button to apply and exit the scenario:
The second case of state transition: the application cannot be run or suspended in the background. The state transition is shown in figure 2-23. There are four stages and five states: Active → Inactive → Background → Suspended → Notrunning.
1. In the Active → Inactivd stage. The application changes from active to inactive (does not involve the methods and notifications we want to focus on)
2. In the Inactive → Background stage. The application goes from the inactive state to the background (does not involve the methods and notifications we want to focus on)
3. In the Background → Suspended stage. Call applicationDidEnterBackground: method, issue
UIApplicationDidEnterBackgroundNotification Notification
4. In the Suspended → Notrunning stage. Call applicationWillTerminate: method, issue
UIApplicationWillTerminateNotification Notification
3. Click the Home button to apply the exit scenario:
IOS does not support multitasking before iOS4, so when you select the home key, the application will exit and be interrupted; but after iOS4, the operating system supports multitasking, and the application of selecting the home key will not be interrupted when it enters.
The application can also do some processing work in the background, so it will enter the suspended state after the processing is finished. if you want to quickly go to the iOS multi-taskbar, you can double-click the home key, where you can see applications running or suspended in the background, and there are likely to be terminated applications residing here. If you press these icons for a long time, you can delete these applications to free memory manually, as shown below:
Thank you for reading this article carefully. I hope the article "how to realize the exit scenario of iOS" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.