Note that there are some explanatory texts on larger screens.

plurals
  1. PODoes simulator supports background modes
    primarykey
    data
    text
    <p>How to start a background voice process. Does simulator supports background modes in iOS.</p> <p>This is my code to start a background process.But its not working.when i press the home button recording stops.</p> <pre><code>-(void)applicationDidEnterBackground:(UIApplication *)application { if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]) { //Check if our iOS version supports multitasking I.E iOS 4 if ([[UIDevice currentDevice] isMultitaskingSupported]) { //Check if device supports multitasking UIApplication *application = [UIApplication sharedApplication]; //Get the shared application instance __block UIBackgroundTaskIdentifier background_task; //Create a task object background_task = [application beginBackgroundTaskWithExpirationHandler: ^ { [application endBackgroundTask: background_task]; //Tell the system that we are done with the tasks background_task = UIBackgroundTaskInvalid; //Set the task to be invalid //System will be shutting down the app at any point in time now }]; //Background tasks require you to use asyncrous tasks dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ //Perform your tasks that your application requires NSLog(@"\n\nRunning in the background!\n\n"); NSString *pollingTimer2 = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(recordPauseTapped:) userInfo:nil repeats:YES]; [application endBackgroundTask: background_task]; //End the task so the system knows that you are done with what you need to perform background_task = UIBackgroundTaskInvalid; //Invalidate the background_task }); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload