didReceiveRemoteNotification - call function in the current view controller
How can i fire a function of a current view controller(currently user viewing) when i receivin开发者_如何学Cg a push notification.
thanks in advance..
The best method is to, in your app delegate's method to handle the remove notification, send out a notification using NSNotificationCenter
[[NSNotificationCenter defaultCenter] postNotification:@"remoteNotification" withObject:whateverYouWantHere];
Then use the NSNotificationCenter to add any interested UIViewController's as an observer for the "remoteNotification" name.
精彩评论