【发布时间】:2014-11-14 16:49:35
【问题描述】:
有什么方法可以在新通知到达时刷新或重新加载 UIWebView ?
我一直在尝试寻找答案,但到目前为止一无所获。
知道的人请帮帮我。
谢谢
我尝试了以下但没有...
在 AppDelegate.m
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(reloadWebView:)
name:@"PUSH_NOTIFICATION" object:nil];
}
并将下面的代码放在 MainViewController.m
-(void)receivedNotification:(NSNotification*) notification
{
[_webView reload];
}
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
我是新手……
【问题讨论】:
标签: ios uiwebview refresh apple-push-notifications