Can I programmatically clear my app’s notifications from the iOS 5 Notification Center?

To remove notifications from the Notification Center simply set your icon badge number to zero. [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0]; This only works if the number changes, so if your app doesn’t use the badge number you have to first set, then reset it. [[UIApplication sharedApplication] setApplicationIconBadgeNumber:1]; [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];

How Nike+ GPS on iPhone receives accelerometer updates in the background?

For the sake of providing an answer to this question, even though it is already self answered… “If you use the newer Core Motion API, you can receive updates in the background.” Here is an example: – (void)startAccelerationCollection { [self.motionManager startAccelerometerUpdatesToQueue:[[NSOperationQueue alloc] init] withHandler:^(CMAccelerometerData *data, NSError *error) { dispatch_async(dispatch_get_main_queue(), ^{ [self.accelerometerReadings addObject:data]; }); }]; }

iOS 5 fixed positioning and virtual keyboard

I had this problem in my application. Here’s how I’m working around it: input.on(‘focus’, function(){ header.css({position:’absolute’}); }); input.on(‘blur’, function(){ header.css({position:’fixed’}); }); I’m just scrolling to the top and positioning it there, so the iOS user doesn’t notice anything odd going on. Wrap this in some user agent detection so other users don’t get this behavior.