multitasking

The exact moment iOS takes the view snapshot when entering background?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 18:21:01
I have a problem when putting my iPhone app to background by pushing the exit button, and then relaunching by tapping the launch icon on the home screen: the app's view does return to its initial state like I want it to, but before that it flashes the earlier, wrong view state onscreen briefly. Background My main view consists basically of a sequence of interlinked UIAnimateWithDuration calls. The behavior I want whenever any interruption occurs, is to reset the animation to its initial state (unless the animations have all finished and the app has entered the static final phase), and start

multiple parallel async calls with await

血红的双手。 提交于 2019-11-28 17:48:25
As far as I know, when runtime comes across the statement below it wraps the rest of the function as a callback to the method which is invoked asynchronously ( someCall() in this example). In this case anotherCall() will be executed as a callback to someCall() : await someCall(); await anotherCall(); I wonder if it is possible to make runtime perform like this: call someCall() in async fashion and return immediately to the calling thread, then invoke anotherCall() similarly (without waiting someCall to complete). Because I need these two methods to run asynchronously and suppose these calls

Use of background/foreground methods in AppDelegate

爱⌒轻易说出口 提交于 2019-11-28 16:49:58
I'm planning to implement multi-task in my app. I can see many methods here to do that in the AppDelegate like applicationWillResignActive , applicationDidEnterBackground , applicationWillEnterForeground , ... But.... I don't see the way they should be used, nor why they are not in the ViewControllers... Nor what they are here for. I mean : when the app enter in background, i don't know on which view my user is. And back, when the app comes into foreground, how would I know what to do and what I may call, to update the view for example ? I would have understood if those methods where in each

Detecting user settings for Background App Refresh in iOS 7

六眼飞鱼酱① 提交于 2019-11-28 16:05:13
Starting with iOS 7, Apple's Multitasking APIs allow apps to run in three new Background Modes: Background fetch, Remote notification content, and Background transfer service. Apple also gives iOS users the ability to control whether all apps are allowed to run in the background or whether individual apps can run in the background (Settings > General > Background App Refresh). Is there is a way for my app to programmatically detect whether the user has disabled my app's ability to refresh in the background? this is what you are looking for. if ([[UIApplication sharedApplication]

How does the OS scheduler regain control of CPU?

不打扰是莪最后的温柔 提交于 2019-11-28 15:52:48
I recently started to learn how the CPU and the operating system works, and I am bit confused about the operation of a single-CPU machine with an operating system that provides multitasking. As such, supposing my machine has a single CPU, this would mean that, at any given time, only one process could be running. Now, I can only assume that the scheduler used by the operating system to control the access to the precious CPU time is also a process. Thus, in this machine, either the user process or the scheduling system process is running at any given point in time, but not both. So here's a

Difference between multitasking, multithreading and multiprocessing?

徘徊边缘 提交于 2019-11-28 15:11:22
Whats the difference between multitasking, multiprogramming & multiprocessing This comes regularly for my university OS exams and I can't find a good answer. I know quite a bit about multitasking and multiprogramming, but need to confirm it. Paraphrasing wikipedia: Multiprogramming - A computer running more than one program at a time (like running Excel and Firefox simultaneously) http://en.wikipedia.org/wiki/Multiprogramming Multiprocessing - A computer using more than one CPU at a time http://en.wikipedia.org/wiki/Multiprocessing Multitasking - Tasks sharing a common resource (like 1 CPU)

Force app to close and run in background

ε祈祈猫儿з 提交于 2019-11-28 14:10:26
we have an app that has a specific purpose where an exit is required. After the exit a process needs to run in the background for a certain amount of time or until finished. We just need to know how to programmatically force the app to enter the background where processes can continue running. Any help on this would be great! Thanks in advance! UPDATE: We have confirmed that there does not seem to be a programmatic way to force the app to quit / enter background and continue running background tasks. You can force the the app to exit using exit(0); but this kills the app all together. However,

How to implement Task completion

拟墨画扇 提交于 2019-11-28 12:00:37
问题 Task completion — applications can ask the system for extra time to complete a given task. I am using this method for Task Completion, - (void)applicationDidEnterBackground:(UIApplication *)application { UIApplication *app = [UIApplication sharedApplication]; bgTask = [app beginBackgroundTaskWithExpirationHandler:^ { NSLog(@"This is Testing"); [app endBackgroundTask:bgTask]; bgTask=UIBackgroundTaskInvalid; }]; } But i am not getting any output from this method. Anyone tell me, what i am doing

Phonegap background service on iOS4?

纵饮孤独 提交于 2019-11-28 11:43:31
Can I get a phonegap application running on iOS 4 to have a background service when it's not the active app (e.g. check a url every hour and alert the user if there have been any changes)? And if so, how? Yes, you can do that, but Apple will probably disallow it. Background running is bound to VERY specific rules. For this kind of stuff Apple invented Push Notifications (from server). You can read the developer documentation about that. The best way to achieve this would be to create a plugin for PhoneGap, which runs natively on the phone. PhoneGap recommends that any heavy lifting be done by

Detecting when app is becoming active from lockscreen vs other on iOS7

☆樱花仙子☆ 提交于 2019-11-28 09:58:06
My app has different behavior when becoming active from the lockscreen (locked while active), or becoming active from anything else. On iOS 6 and lower I could detect this UIApplicationState state = [[UIApplication sharedApplication] applicationState]; if (UIApplicationStateInactive == state) // Coming from locked screen (iOS 6) else // Coming from Springboard, another app, etc... But on iOS 7, the state value is UIApplicationStateBackground in both scenarios. Is this the intended behavior? How can I properly detect whether the app is launching from the lockscreen now? Registered devs, I