Multi level Table Multiple Detail window issues in Xcode

I am using a split-view application in Xcode for iPad. I need to work with one multi level (Table) menu in Root View. Based on this menu I need to display detail views in detail window.
The current code works on the single level menu but it is not working on the multi level menu concept.
For example I have one root menu for 'Search' which did not have sub menu. If I click the Search, the detailed search window appears in detail section. But another main menu 'Patient' which has 2 sub menus 'Add Patient' and 'Patient Insurance', each having its own detail windows which needs to appear on the right side. But on clicking on these sub menu items the detailed section does not appear. While searching about this problem I got one answer that if we load sub table we need to reload the detail view again. If so how I can do it?If required I can give my sample code for the event didSelectRowAtIndexPath

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    /*
     Create and configure a new detail view controller appropriate for the selection.
     */
    
    NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
    NSArray *Children = [dictionary objectForKey:@"Children"];
    if([Children count] == 0) {
        
        
        firstDetailViewController.detailItem=[dictionary objectForKey:@"Title"];
        secondDetailViewController.detailItem=[dictionary objectForKey:@"Title"];
        thirdDetailViewController.detailItem=[dictionary objectForKey:@"Title"];
        
        
        UIViewController <SubstitutableDetailViewController> *detailViewController = nil;
        
        
        if ([[dictionary objectForKey:@"Title"] isEqualToString: @"Patient Information"]==YES)//This is sub menu
        {
            SecondDetailViewController *newDetailViewController = [[SecondDetailViewController alloc] initWithNibName:@"SecondDetailView" bundle:nil];
            detailViewController = newDetailViewController;
        }
        else if ([[dictionary objectForKey:@"Title"] isEqualToString: @"Insurance Information"]==YES)//This is sub menu
        {
            ThirdDetailViewController *newDetailViewController = [[ThirdDetailViewController alloc] initWithNibName:@"ThirdDetailViewController" bundle:nil];
            detailViewController = newDetailViewController;
        }
        else if ([[dictionary objectForKey:@"Title"] isEqualToString: @"Search Patient"]==YES)//This is root menu without child
        {
            SearchPatient *newDetailViewController = [[SearchPatient alloc] initWithNibName:@"SearchPatient" bundle:nil];
            detailViewController = newDetailViewController;
        }
        else //This is root menu without child
        {
            FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc] initWithNibName:@"FirstDetailView" bundle:nil];
            detailViewController = newDetailViewController;
        }
        // Update the split view controller's view controllers array.
        viewControllers = [[NSArray alloc] initWithObjects:self.navigationController, detailViewController, nil];
        splitViewController.viewControllers = viewControllers;
        [viewControllers release];
        [RootViewController release];
        
        
        // Dismiss the popover if it's present.
        if (popoverController != nil) {
            [popoverController dismissPopoverAnimated:YES];
        }
        
        // Configure the new view controller's popover button (after the view has been displayed and its toolbar/navigation bar has been created).
        if (rootPopoverButtonItem != nil) {
            [detailViewController showRootPopoverButtonItem:self.rootPopoverButtonItem];
        }
        
        [detailViewController release];
         
    }
    else
    {//front right wheel coonnect accle. middle ball bairing 
        
        //Prepare to tableview.
		RootViewController *rvController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]];
		
		//Increment the Current View
		rvController.current_level += 1;
		
		//Set the title;
		rvController.current_title = [dictionary objectForKey:@"Title"];
		
		//Push the new table view on the stack
		[self.navigationController pushViewController:rvController animated:YES];
		
		rvController.tableDataSource = Children;
		[rvController.tableView reloadData]; //without this instrucion,items won't be loaded inside the second level of the table
		[rvController release];
    }    
    
}

Open in new window

magnicodesolutionsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

darbid73Commented:
I hope I understand you.

In your root view table didSelectRowAtIndexPath you need to decide on whether to show a detailview (search) or if you push a sub menu table which is what you will do if the user selects Patient for example.

Then in the Patient table you will then have in didSelectRowAtIndexPath the ability to show the appropriate detailview.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
magnicodesolutionsAuthor Commented:
But I am using one Menu.plist file which is a dictionary for showing table view data as menu. Patient is the main menu. It is showing the 2 sub menu's if we click. But that sub menu click is not working.
0
darbid73Commented:
Ok then I dont understand.

Your first table will have a datasorce of an array of things.  This array will not have any secondary names in it.

eg

Menu 1
Motor Vehicles
Airplanes
Boats
Search

if the person touches the row 1 (Motor Vehicles)
then you push a new table onto the root view with

Menu 2
Cars
Trucks


if they push Search then you do not push a new root view you change the detail view to what you want.





0
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

magnicodesolutionsAuthor Commented:
If click Search in Detail Window it will display Search Page because there is no sub menu. If we click Moto Vehicles the root View controller reload the sub table Car,Trucks. If we click Trucks it will show Trucks Page in detail window. My Menu.plist file for loading menu is attached.


menu.JPG
0
magnicodesolutionsAuthor Commented:
I've requested that this question be deleted for the following reason:

I need to change question
0
magnicodesolutionsAuthor Commented:
no need. Cancel the deletion request
0
darbid73Commented:
you work out what your question is an get back to me.

But that structure looks like An Array of 3 objects which are dictionary items.

Then the objectAtIndex:1 which is a dictionary has 2 objects - a NSString and and Array of objects - these objects are Dictionaries.

This is not an easy structure to work with.  But if it is I suggest you work on getting out 2 arrays and use these arrays for your tables.

0
magnicodesolutionsAuthor Commented:
Sorry for trying to delete the question. This is the valid question.
0
magnicodesolutionsAuthor Commented:
For getting the actual problem please visit the following link.

Update Detail View

Here they mentioned that if we push a new controller onto the nav stack, then its not automatically going to know about DetailViewController
But here I have more than one detail views. So how to manage it?
0
darbid73Commented:
I cannot get the link to work.
0
magnicodesolutionsAuthor Commented:
0
darbid73Commented:
The answer there is exactly what I would say as well.

What you should do is set up a class that imports all these views or use the app delegate, but another class is better.  then you use this to communicate between all your views.

If don't want to do this then any sub menu pushed controller is going to have to import the detail view you want so that it has access to it (and not a new instance of the detail view) but the same one you have already used.
0
evilrixSenior Software Engineer (Avast)Commented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
darbid73Commented:
The question has been answered.  Further the user is satisfied to such a level that he has not responded or further queried what I have told him.  Thus he has got what he wanted.
0
darbid73Commented:
After the questioners response in http:#a37279869 the actual answer to this question is in fact http:#a37278165.  Further clarification and how to deal with his classes in this problem are shown given in http:#a37280269.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
iOS

From novice to tech pro — start learning today.