small problem with calendar test application
http://blog.webscale.co.in/?p=244
From the above i download Calendar Test application...
i got calendar and tableview....in a same View.
Now i created another class DetailedViewController which is UIViewControllerSubClass.
Now for the selected row i need to display the detailedViewController Nib file.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
NSLog(@"Calling");
DetailedViewController *detailedView=[开发者_开发问答[DetailedViewController alloc] initWithNibName:@"DetailedViewController" bundle:nil];
[self.navigationController pushViewController:detailedView animated:YES];
[detailedView release];
detailedView=nil;
}
Which is not navigating to my detailedView
What to do for navigation.
@All Please help me out.
You download an View Based Application so if you want to display Detail vIew on tapping a row then change your code like
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
NSLog(@"Calling");
YourAppDelegateClass *obj=(YourAppDelegateClass *)[[UIApplication sharedApplication] delegate];
DetailedViewController *detailedView=[[DetailedViewController alloc] initWithNibName:@"DetailedViewController" bundle:nil];
[obj.window addSubview:detailedView];
[detailedView release];
detailedView=nil;
}
You have to make a navigation controller in AppDelagate method as,
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:calender];
[window addSubview:navController.view];
[window makeKeyAndVisible];
and then do that in didSelectrow method
[self.navigationController pushViewController:detailedView animated:YES];
Hope this helps.
精彩评论