fast-app-switching

UIApplication openURL background

夙愿已清 提交于 2019-12-17 16:29:08
问题 In my iOS 4 application, I need to open a URL from the background, at a time specified from the user. However, for some reason, I cannot launch a URL from the background for some reason. Here is my code for opening a URL: if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.stackoverflow.com"]]) { // the URL wasn't opened. we will ignore this for now. } That code is all being launched from a daemon thread created earlier. I have tested this code on the simulator,

Why should we copy blocks rather than retain?

别来无恙 提交于 2019-12-10 17:36:07
问题 I recently met a problem using blocks with Facebook's app switching. I needed to call a block after the Facebook login. First my block was destroyed when the app switched back ('cause it was on the stack), so I decided to retain it. But that didn't work, and I messed with that problem :/. I found a solution on that blog and also here. My question is simply : why copy works and retain does not ? 回答1: Because when you create a block there is nothing to retain, since it doesn't exist in the heap

Grey GPS arrow shown in statusbar although location based application killed using Fast App Switcher

て烟熏妆下的殇ゞ 提交于 2019-12-01 08:20:28
I am writing a location based application for iOS 5. The application is using the CLLocationManager to receive Location updates. When the application is started I am creating the LocationManager, calling [self.locationManager startUpdatingLocation]; and the grey location arrow appears in the statusbar. When the application enters background I am calling [self.locationManager stopUpdatingLocation]; [self.locationManager startMonitoringSignificantLocationChanges]; cause I just want to receive significant location changes while the app is in background. The grey location arrow is still shown. I

UIApplication openURL background

烂漫一生 提交于 2019-11-27 23:12:29
In my iOS 4 application, I need to open a URL from the background, at a time specified from the user. However, for some reason, I cannot launch a URL from the background for some reason. Here is my code for opening a URL: if (![[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.stackoverflow.com"]]) { // the URL wasn't opened. we will ignore this for now. } That code is all being launched from a daemon thread created earlier. I have tested this code on the simulator, and the URL is not opened, and the method returns YES for some reason, but when I open my application