I have a working UITableView in my view controller. It is being successfully populated and seems to be fine. However, when I try using following function, new view is not loaded (function is called, I get output from NSLog):
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"asf");
[self.navigationController pushViewController:sendRequestFavoriteController animated:YES];
}
What might be a problem? I get no compilation or debugging errors/warnings.
EDIT: I have tried allocating and initializing a view controller manually. I believe Plamen is right, because self.navigationController is nil. However, I have not yet succeeded.
EDIT2: I use [self.navigationController pushViewController:.. function successfully in the rest of the application. That’s the only exception. navigationController is nil when i have UITableView. Why is that? What to do?
alt text http://files.droplr.com/files/11625842/AUk9W.Screen%20shot%202010-03-14%20at%2009.56.42.png
ChriB is right. Here’s his comment:
The thing is I should have add UINavigationController in the main view (in Interface Builder), then UIViewController inside. My mistake was to add UIViewController directly.