我正在使用Storyboard,這是一個TabBarApplication。我如何設計它是每個選項卡都有UINavigationController,然後對應的UIViewController。 現在,當我收到一個UILocalNotification我想要一個特定的視圖,我想要顯示這個。如何在我收到UIlocalnotification時直接顯示UIViewController?
我在didReceiveLocalNotofication
if (!_tabBarController) {
_tabBarController = (UITabBarController *)_window.rootViewController;
}
NSArray *notificationName = [notification.userInfo valueForKey:@"kDetails"];
NSString * identifer = [notificationName objectAtIndex:1];
NSArray * vcs = [_tabBarController viewControllers];
UINavigationController * listVC = [vcs lastObject];
NSArray * array = [listVC viewControllers];
ListViewController * contacts = [array lastObject];
DetailsViewController * details = [[DetailsViewController alloc]initWithNibName:@"DetailsViewController" bundle:nil];
contacts.navigationItem.title = @"Details";
details.dataSet = [NSMutableArray arrayWithArray:[PersistData sharedData].completeData];
for (int i=0; i<[details.dataSet count]; i++) {
DataType * wid = [details.dataSet objectAtIndex:i];
if ([wid.identifier isEqualToString:identifer]) {
// This is the meeting
details.index = i;
}
[contacts.navigationController pushViewController:details animated:YES];
}
notification.fireDate = nil;
這樣做,但這種不顯示所需的視圖。
嗨..你的問題解決? – Rajneesh071
還沒有。這隻會讓我進入我想去的Tab,但我仍然需要進一步進入特定的控制器。 – Ashutosh