Hey there, Cocoa List! I've got a question about background tasking, and I couldn't really answer myself it by searching in the documentation (or even in the internet). I want to make a background task with an application. Firstly, I used the code they gave as a sample, which looks like this:
- (void)applicationDidEnterBackground:(UIApplication *)application { UIApplication* app = [UIApplication sharedApplication]; bgTask = [app beginBackgroundTaskWithExpirationHandler: ^{ [app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid; }]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self showALocalNotification]; [app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid; }); } It actually shows my local notification, but I want the application to check for some conditions (like "Is the Device charging?" or "In what way does the user hold the device?"), and if certain conditions are complied with, I want to show the local notification. So I only want that the Device sends me a message from time to time (like every 10 seconds), then I execute a little bit of code, and maybe show this notification. Does somebody know if this is possible? Thanks in before, Lukas_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com