multitasking

Using lock screen for my app?

蓝咒 提交于 2019-11-30 07:41:35
I'd like to make my app use the audio buttons on the lock screen while multitasking. (Yes, like Pandora.) What API am I looking to use? See the Remote Control of Multimedia docs. Basically, you just need to call -beginReceivingRemoteControlEvents on your shared application instance, then register something (probably your main view controller) as the first responder and implement the -remoteControlReceivedWithEvent: method on it. You will get events both from the lock-screen controls and from the headset clicker, as well as the control buttons to the left of the multitasking drawer. To play

How does the OS scheduler regain control of CPU?

风格不统一 提交于 2019-11-30 06:13:05
问题 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

iOS 4 Alarm Clock App with Multitasking Support

自作多情 提交于 2019-11-30 03:50:35
I'm making an alarm clock app with multitasking support. However, I'm stuck with some limitations of the sdk. I need to play selected alarm sound whenever the alarm time comes with some properties set by the user. These properties: - Alarm sound can be a music from the user's iPod library, and also some sound files in application bundle. - Alarm sound can be set to play as progressive. Moreover, alarm sound must be played in background in a loop until the user cancels or wakes the app. First logical thing that came to my mind was to use local notifications, but with local notifications you can

App inside an app

廉价感情. 提交于 2019-11-29 22:38:15
Is it possible to run an application from inside another application? What I want to do is write an app which allows you to chose an app to start, and then displays the activities of this app inside a view. So in landscape mode, it should look something like this: The idea behind this is: I want to be able to start and run a third party activity next to my own activity, and I want to be able to create individual makros with my activity that are controlling the third party activity. Basically, something like this: Start third party activity from inside my app Start makro recording Do something

UIApplicationBackgroundRefreshStatusDidChangeNotification usage without corresponding delegate method

本小妞迷上赌 提交于 2019-11-29 15:23:16
问题 I feel that UIApplicationBackgroundRefreshStatusDidChangeNotification introduced in iOS 7 is of little use without supporting UIApplication delegate method. Because, the app is not notified when user has switch ON the background refresh state for my app. This is my notification handler... - (void)applicationDidChangeBackgroundRefreshStatus:(NSNotification *)notification { NSLog(@"applicationDidChangeBackgroundRefreshStatus with notification info = %@ and refresh status = %d", notification,

Quit app when pressing home

南楼画角 提交于 2019-11-29 11:26:14
I my testing, when I exit (by pressing the home button) my app, it still is "running" in the background, thanks to the multitasking feature. However, I would like it to quit when the home button is pressed. Is this only happening to me? Anyway, I have tracked it down to the applicationWillResignActive and the applicationDidBecomeActive methods in the app delegate. These get called for multitasking, but when I want to terminate, the app "resigns active." Any guidance on this issue is greatly appreciated! Your application can opt out of multitasking (see the appropriate section in the iPhone

socket connection killed after iOS app goes to background

爱⌒轻易说出口 提交于 2019-11-29 07:16:28
Iam using an iPhone app chat uses socket connection to communicate with the server. When the app is moved to background i can see that the server is able to communicate with the app for about 5 minutes. But after this time, the socket connection is destroyed. But the app stops executing as soon as it moves to background.Why is it that the socket connection is maintained for 5 minutes but not the app execution.Does apple specify the exact time for which the connection would be maintained. Pushpak Narasimhan You can get a max time of 600 sec(10 min) by using making use of following code in

applicationWillEnterForeground: reload Data from ViewController

早过忘川 提交于 2019-11-29 05:02:10
I want my app to reload data as soon as the app switches from the background to the foreground. Thats my code: DataAppDelegate.h #import <UIKit/UIKit.h> #import "DataViewController.h" @class DataViewController; @interface DataAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; DataViewController *viewController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet DataViewController *viewController; @end AppDelegate.m #import "DataAppDelegate.h" #import "DataViewController.h" @implementation DataAppDelegate @synthesize window;

How to refresh UITableView after app comes becomes active again?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 02:37:36
I would like my UITableView to reloadData once my app is active again, after a user exits the application. I know I need to implement (in my app delegate): - (void)applicationDidBecomeActive:(UIApplication *)application but im not sure how to reference the current UITableView? UPDATE: My UITableView is a separate controller. It is actually presented as follows AppDelegate > Root View Controller > Pushes UITabBarController modally which has a UITableViewController Aaron Saunders following up on Ole's answer above add this when initializing the viewcontroller [[NSNotificationCenter defaultCenter

Want app upgraded to 4.0 to exit completely when home button pressed

删除回忆录丶 提交于 2019-11-28 20:57:36
I am working on an app for iOS 4.0. The app was originally on 2.2.1. I upgraded it to a universal app, but now it seems to be multitasking. When I press the menu button while running the app, instead of exiting it closes, but when I relaunch the app it resumes where I left off. I am assuming this is multitasking. I want it to exit, is there a way in the settings? My guess is that the iPad target upgrade changed the plist somehow? Any thoughts? Open your info.plist file Add The Key UIApplicationExitsOnSuspend or Select Application does not run in background Set the new key to YES or Fill in the