【发布时间】:2015-01-09 11:52:28
【问题描述】:
我得到了一个 UILocalNotification,它以这种方式在 UIViewController 的 UIView 部分中发送:
[[UIApplication sharedApplication] scheduleLocalNotification:_localNotif];
我希望我的应用在以下情况下响应它:
- 在后台时:如果用户点击通知唤醒应用并加载相应的 UIViewController(有多个 UIViewController)
- 在前台时:刷新当前 UIViewController 中的数据
文档引导我在 AppDelegate.m 中修改此方法:
- (void)application:(UIApplication *)application didReceiveLocalNotification: (UILocalNotification *)notification {
NSLog(@"received notification");
//reload views
}
但是我不知道如何重新加载 UIViewController。
- 我可以使用 UILocalNotification 的哪些属性来确定哪些 UIViewController 发送了吗?
- 如何从 AppDelegate 加载特定的 UIViewController?
【问题讨论】:
标签: ios objective-c iphone uiviewcontroller uilocalnotification