So, I am creating a view based application. I have a TableView setup to that displays all of my information and a user can scroll that information. However, what I want it to be able to accomplish is when a user clicks on a particular cell in the TableView it loads up a View displaying detailed information about the item that was clicked on.
I know that this can be accomplished very easily had I done my project as a nav based app, but I'm not sure as to why I'm having such difficulty doing this in a view based app.
Some background info on this project:
The app has many purposes. It's something I'm creating for a senior project class. Clicking on the app from the homescreen launches another screen with more buttons to click on for other features. One button loads up a view tied in with google maps in standard/satellite/hybrid. Another button will load up a view with a UIWebView that loads up an image from Resources which the user can zoom in/out, etc. The button I'm having issues with is one called Buildings. Clicking buildings loads up another View with a UITableView on it. The cells populate with an array that was setup. So, basically what I'm attempting to do is have the user click on one of the cells in the UITableView and then load up the DetailView.
The code for selecting the row is as follows:
I'm still so new to this, so I suppose I'm having trouble explaining everything, but any help trying to get this to work would be GREATLY appreciated.
I know that this can be accomplished very easily had I done my project as a nav based app, but I'm not sure as to why I'm having such difficulty doing this in a view based app.
Some background info on this project:
The app has many purposes. It's something I'm creating for a senior project class. Clicking on the app from the homescreen launches another screen with more buttons to click on for other features. One button loads up a view tied in with google maps in standard/satellite/hybrid. Another button will load up a view with a UIWebView that loads up an image from Resources which the user can zoom in/out, etc. The button I'm having issues with is one called Buildings. Clicking buildings loads up another View with a UITableView on it. The cells populate with an array that was setup. So, basically what I'm attempting to do is have the user click on one of the cells in the UITableView and then load up the DetailView.
The code for selecting the row is as follows:
Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//Get the selected building
NSString *selectedBuilding =[listOfBuildings objectAtIndex:indexPath.row];
//Initialize the detail view controller and display it.
DetailBuildingViewController *dvController = [[DetailBuildingViewController alloc] initWithNibName:@"DetailBuildingViewController" bundle:[NSBundle mainBundle]];
dvController.selectedBuilding = selectedBuilding;
[self.navigationController pushViewController:dvController animated:YES];
[dvController release];
dvController = nil;
}
I'm still so new to this, so I suppose I'm having trouble explaining everything, but any help trying to get this to work would be GREATLY appreciated.