有什麼方法可以在新通知到達時刷新或重新加載UIWebView?iOS如何在didReceiveRemoteNotification上刷新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];
}
我把下面的代碼相當新手...