这是我的应用程序代表
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:2];
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
UINavigationController *nav=[[[UINavigationController alloc]initWithRootViewController:self.viewController ] autorelease];
nav.navigationBar.hidden=YES;
self.window.rootViewController = nav;
[self.window makeKeyAndVisible];
return YES;
}
-(void)application:(UIApplication *)application performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
NSLog(@"########### Received Background Fetch ###########");
//Download the Content .
[self sometask]; // i want to do some task here but this method get called only ones when i try to launch application
//Cleanup
completionHandler(UIBackgroundFetchResultNoData);
}
所以问题是 performFetchWithCompletionHandler 只被调用是的,我已经在信息 pList 中完成了所有操作,但没有帮助,请提出一些建议