KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm quite new to xcode, and I am trying to develop a sample app that is basically an embedded tableview which has many levels. I have a plist which stores the cells of each tableview. If the cells do not have children, then I want to be able to go to one detailed view once the cell is pressed. Eventually I want to be able to go to different detailed views depending on data type. To do this, I created a detailed view from storyboard, dragged my view controller to my detailed view to create a manual "Push" segue, and labeled the segue "segue1". Edit: Source code here Next I populate what I assumed to be the necessary functions for this to work, which is to call [self performSegueWithIdentifier:@"segue1" sender:myString]; where myString is the title of the cell I selected. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Check the dictionary to see what cell was clicked NSDictionary *dict = [self.tableDataSource objectAtIndex:indexPath.row]; NSString *myString = [dict objectForKey:@"Title"]; NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; NSArray *children = [dictionary objectForKey:@"Children"]; //If there is no children, go to the detailed view if([children count] == 0) { [self performSegueWithIdentifier:@"segue1" sender:myString]; } else{ //Prepare to tableview. DrillDownViewController *rvController = [[DrillDownViewController alloc] initWithNibName:nil bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.CurrentLevel += 1; //Set the title; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; //Push the new table view
Tags (comma-separated)
Save Edits
Cancel