开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜