iOS application continued background timeCategory:iOS development related(877) (0)Because of Apple's background mechanism, when we press the home button, all threads including the main thread of the task will be suspended, some resources such as the socket will be collected by the system, will cause a lot of problems,
layer, we actually have 0, 1, 2 in the sub-view array. The allocation order also changes synchronously, this is known when using Exchangesubviewatindex, because it is directly the order of the array of exchanges, you can check Nsarray by the following methods: Subview2=self.view.subviewS UIView *view11=[subview2 Objectatindex:5]; View11.backgroundcolor=[uicolor Purplecolor]; [Super Viewdidload]; Do any additional setup after loading the view, typically from a nib.} We want to change th
Based on the screen size. In addition, you should pay attention to the use at the right time.TransitionCoordinatorOf-AnimateAlongsideTransition:To make the switch more natural.
Multi-task brings the possibility of multiple apps running on the same platform, so your apps will certainly be running together with other apps. When developing a mobile application, you must never forget the limitations of the device platform. Compared with desktop devices,
] endBackgroundTask:self.backgroundTaskIdentifier];Strongself.backgroundtaskidentifier = Uibackgroundtaskinvalid; }}); }At the end of a long mission, we need to do something to clean up:1. End all threads and timers, whether they are created in the base timer or GCD.2. Call UIApplication's Endbackgroundtask: method to end the background task.3. Set the
Because the iOS system is "pseudo background" mode, when the home button is pressed, such as the program does not do anything, the application will have 5 seconds of execution buffer time, the random program is suspended, all the task terminal, including timer and location update operation, but the program open
IOS background running
WenyiI learned from the apple documentation that a general application can get a certain amount of time to run related tasks when entering the background, that is, it can run a short period of time in the background.
Three other types can be run after,
1. Music
2. location
3. voip
Article 2
Ex
Directory (?) [-]
Status of the application
The life cycle of an application
1 loading applications into the foreground
2 loading applications into the background
3 about the main function
Response interruption
1 when an alert-based interrupt occurs, such as when a call comes in, this is the program that temporarily enters the inactive state. This user can choose how to handle this interrupt process
-sensitive background tasks).
When the program returns to the active state,applicationDidBecomeActive:The method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically. 4, go to the ba
Wen YiI learned from the Apple documentation that the general application can get a certain amount of time to run the task in the background, that is, it can run in the background for a short period of time.There are also three kinds of types that can be run at the rear,1. Music2.location3.voipWen ERIn iOS
, applicationDidBecomeActive: The method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically. 4, go to the background to run 4.1:ps: only in the IOS4 system or support multi-tasking devices to run in the
method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically. 4, go to the background to run 4.1:ps: only in the IOS4 system or support multi-tasking devices to run in the background
program returns to the active state, applicationDidBecomeActive: The method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically. 4, go to the background to run 4.1:ps: only in the IOS4 system or support multi-tasking device
-sensitive background tasks).
When the program returns to the active state,applicationDidBecomeActive:The method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically. 4, go to the ba
: The method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically. 4, go to the background to run 4.1:ps: only in the IOS4 system or support multi-tasking devices to run in the background
, applicationDidBecomeActive: The method should start again with the tasks mentioned above, such as restarting the timer, continuing to distribute the queue, and increasing the frame rate of OpenGL es. However, the game will go back to a paused state and not start automatically.4, go to the background to run4.1:PS: Only in the IOS4 system or multi-tasking devices can be run in the
about multitasking and memory management for iOSsee a lot of people for their available memory is 350MB or 380MB tangled. In order to optimize a little bit of available memory cost brains. The task management and memory management of iOS is very different from that of Windows. Many people are accustomed to usingthinking of Windows to look at iOS. windows Everyone
IOS-Use of AVAudioSession-playing music in the background, ios-avaudiosession1. Preface • AVAudioSession is a singleton that can be directly used without instantiation. AVAudioSession plays an important role in various audio environments. • different audio session categories must be set for different audio application scenarios.
1.1AVAudioSession category • AVAu
:@ "Score"])){Score = Scorenumber.integervalue;}Ask for more background timeWhen the app is in the background, do not perform more than 5 seconds in the main thread, and the app may be removed from memory if it takes too much time (i.e. Applicationdidenterbackground: the execution of the method spends too much time) in the background.If the application is performing a file download or file transfer, and whe
standarduserdefaults]objectforkey:@ "Score"])){Score = Scorenumber.integervalue;}Ask for more background timeWhen the app is in the background, do not perform more than 5 seconds in the main thread, and the app may be removed from memory if it takes too much time (i.e. Applicationdidenterbackground: the execution of the method spends too much time) in the background.If the application is performing file do
time to complete the necessary operations for our needs:1. We need to have enough time to save the data to the remote server when the application is pushed to the background.2. Have enough time to record some required information operations.What to do?! Because the time we need may be a bit long, by default, iOS doesn't leave us enough time. Tragedy ... There's always a way to solve it ~ ~ ~apply to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.