我正在使用推送通知。我试图在通知中的操作按钮被点击时在navigationController中创建并推送一个DetailView。但navigationController是零。我怎样才能把那个DetailView放在navigationController中?我想在navigationController中推入RootViewController,然后在DetailView中推送RootViewController。我怎样才能做到这一点?如何通过UINavigationController设置navigationController?
在的AppDelegate:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
RootViewController *controller = [[RootViewController alloc] init];
//getting warnings here.(Unused variable navigationController)
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:controller];
[controller doStuff];
[controller release];
}
在RootViewController的:
-(void)doStuff{
[[self stories] removeAllObjects];
[self startParsing];
[self.tableView reloadData];
DetailViewController *detail = [[DetailViewController alloc] init];
//custom code
[self.navigationController pushViewController:detail animated:YES];
[detail release];
这是使用的是现在的代码读音字。而PLZ注意到我
[self.tableView reloadData];
是你想要显示detailView的doStuff吗? – 2011-02-25 00:13:41
是。我认为它可能 – Piscean 2011-02-25 00:15:57