multitasking

Correct way to poll server in background

眉间皱痕 提交于 2019-12-03 03:51:27
问题 Assuming this is possible, I would like my iOS application, when backgrounded, to poll a server (i.e. essentially, retrieve the contents of a URL every 30 minutes and notify the user if it contains something "interesting"), essentially in a similar way to the way the built-in mail client assumedly works if you're not using push notifications. Now, from my reading so far (I'm an experienced programmer, but new to iOS), I think there may be two potential ways to do this: Method 1: In

Reload application data when the app comes into foreground?

一世执手 提交于 2019-12-03 02:06:59
问题 i'm new to iPhone dev ... i'm building an app that loads data from a local sqlite3 db in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { When i tap iPhone button and put it in background and then i recall it i see (as normal) the app in the same way i leaved it. What i would like to do is, when it comes in foregroud, to reload data as if it was called from scratch. Which is the correct way to do it? Thanks in advance c. 回答1: -

C# first class continuation via C++ interop or some other way?

邮差的信 提交于 2019-12-02 20:12:20
We have a very high performance multitasking, near real-time C# application. This performance was achieved primarily by implementing cooperative multitasking in-house with a home grown scheduler. This is often called micro-threads. In this system all the tasks communicate with other tasks via queues. The specific problem that we have seems to only be solvable via first class continuations which C# does not support. Specifically the problem arises in 2 cases dealing with queues. Whenever any particular task performs some work before placing an item on a queue. What if the queue is full?

How to use AVCaptureSession with Slide Over and Split View in iOS 9?

喜欢而已 提交于 2019-12-02 19:10:55
My team is developing a set of SDKs for barcode scanning , ID scanning and OCR . We use device's camera, specifically, AVCaptureSession , to obtain video frames on which we perform our processing. We're exploring new iOS 9 multitasking features Slide Over and Split View. Apple suggests opting out of these features for camera-centric apps, where using the entire screen for preview and capturing a moment quickly is a primary feature ( reference ). This is the approach the use in their sample app AVCam . However, our customers might have apps which don't fall into this category (e.g Mobile

How to do multithreading, concurrency or parallelism in iOS Swift?

点点圈 提交于 2019-12-02 15:31:45
Is there any way to create a worker thread in Swift?, for example, if there's a major functionality that requires a lot of calculations and hence causes the main thread to delay for a few seconds, if I would like to move that functionality to a separate thread or a thread that do not block the main thread is there any way to do it with Swift? I've gone through the basic and advanced components of the Apple Documentation for Swift but there's nothing about concurrency or parallelism, do anyone know something about how to do it(if possible)? Rob Or you can use operation queues, too. In Swift 3:

Background downloading even if the phone gets locked

折月煮酒 提交于 2019-12-02 10:20:27
问题 I am trying to implement an application for iPhone that should simply download some content out of the web. This download is quite big, so I implemented the download as a background task to give the user the chance to do some other stuff with his phone while downloading. My problem is that if the user pushes the lock button (or if auto lock kicks in) the applicationWillResignActive: in the AppDelegate is called and after about ten seconds the download is aborted because the phone does not

iPhone OS 4.0.x - transition from background to foreground

丶灬走出姿态 提交于 2019-12-02 09:19:41
iPhone programming question: Is it possible to wakeup/resume iPhone application from background mode to foreground mode programmatically? I have a long-running background task, which is being launched in applicationDidEnterBackground method of UIApplicationDelegate. I need to make my application active/visible using some code inside this background task. Is this possible? Thanks. This is not possible. However, you can fire a local notification to alert the user. 来源: https://stackoverflow.com/questions/3419559/iphone-os-4-0-x-transition-from-background-to-foreground

Background downloading even if the phone gets locked

為{幸葍}努か 提交于 2019-12-02 04:16:38
I am trying to implement an application for iPhone that should simply download some content out of the web. This download is quite big, so I implemented the download as a background task to give the user the chance to do some other stuff with his phone while downloading. My problem is that if the user pushes the lock button (or if auto lock kicks in) the applicationWillResignActive: in the AppDelegate is called and after about ten seconds the download is aborted because the phone does not enter background and just stays inactive. My question is what am I doing wrong? How can I ensure that the

iOS 4 resume from background

China☆狼群 提交于 2019-12-02 03:43:26
问题 It is possible to get a notification or something when the user opens the application, but the application was in the background (so it wasn't closed)? 回答1: Your App Delegate will have its function applicationWillEnterForeground called before coming back. Also, the OS will have queued a series of potential notifications for significant OS changes if it were freeze dried when those events were fired, ie: UIApplicationSignificantTimeChangeNotification and

iOS 4 resume from background

我只是一个虾纸丫 提交于 2019-12-01 23:45:45
It is possible to get a notification or something when the user opens the application, but the application was in the background (so it wasn't closed)? Your App Delegate will have its function applicationWillEnterForeground called before coming back. Also, the OS will have queued a series of potential notifications for significant OS changes if it were freeze dried when those events were fired, ie: UIApplicationSignificantTimeChangeNotification and UIDeviceBatteryLevelDidChangeNotification 来源: https://stackoverflow.com/questions/3531014/ios-4-resume-from-background