0

我的应用程序是基于位置的应用程序,它运行良好。现在我想在我来自后台时刷新信息。AppDelegate我从它调用请求的方法中调用了一个函数,NSURLConnection并成功获取了一个地方的信息,该位置首先给出。但不会为我分配的其他地方刷新。

代码是:

- (void)applicationWillEnterForeground:(UIApplication *)application
{

  [self.viewController refresh];//api refresh method.
}

现在它发送了我分配的第一个位置的请求,即使它发生了变化,但没有得到修改UIViewController细节。

在这里,我想刷新我给的最后一个请求。但我只为第一名而努力。哇,我能解决这个问题吗?

4

1 回答 1

0
If you are receiving data , the second time you hit the url nad it is not being reflected in the viewcontroller then there might be problem as :-
1>At what Event you might want to refresh data.
2>How are you sending the data to another viewcontroller
Check if the data is reaching the intended viewcontroller successfully

.

另请显示您的刷新方法。如果您的刷新方法有一些参数并且您没有发送这些参数,那么您可以尝试:-

- (void)applicationWillEnterForeground:(UIApplication *)application 
{     
NSLog(@"app will enter foreground");     
[viewController refresh:NULL]; 
} 

如果问题仍然存在,请发布您的代码。

于 2012-05-11T13:46:33.890 回答