I'm working on a navigation-based application. My rootViewController contains 3 cells -When the first one is pressed a UIViewController is pushed (THIS WORKS) -The problem is with the 2nd and 3rd cells that are supposed to push a UITableViewController
The app is running with no errors and it is NOT crashing at all, but when i navigate to the tableview, an empty table is viewed with no elements in it.
Is the problem with this part of the code?? :
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIViewController *detailViewController = [[UIViewController alloc] initWithNibName:@"Introduction" bundle:nil];
detailViewController.title=@"Introduction";
UITableViewController *myPictures = [[UITableViewController alloc] initWithNibName:@"Pictures" bundle:nil];
myPictures.title=@"Pictures";
UITableViewController *myImages = [[UITableViewController alloc] initWithNibName:@"ImagesViewController" bundle:nil];
myImages.title=@"Images";
// Pass the selected object to the new view controller.
if (0 == indexPath.row)
[self.navigationController pushViewController:detailViewController animated:YES];
if (1== indexPath.row)
[self.navigationController pushViewController:myPictures animated:YES];
if (2== indexPath.row)
[self.navigationController pushViewController:myImages animated:YES];
[detailViewController release];
[myPictures release];
[myImages release];