I need some assistance to approach this. I have created a
UITabBarController where I have two tabs. And in one of them I made it to pop with
UIPopoverController where I use a
UITableView dentro de
UIPopoverController. I load the tableView with two objects using table view datasource and I can see them when the
You can check the screen shot here:
Now what I want to achieve is that, when I click on feedback then I need to be directed/taken to
feedbackViewController and the same with the other object Download, it should take me to the
I know that I need to use table view method:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
But I am not having an idea of how I can do this. So any general information of how I can approach this problem would be appreciated.
preguntado el 02 de febrero de 12 a las 11:02
It sounds quite simple. All you need to do is identify which button was pressed, in this case 0 for Feedback and 1 for Download. Then depending on that present the appropriate view controller. You will probably need to have a link to a parent, which will ultimately present the new view. Otherwise you will be presenting the view inside the popover controller.
Somewhere when creating/displaying your
UIPopoverController create a reference to the parent
UIViewController *mainparent = _mainparent; //where _mainparent is the reference passed through.
Entonces en tu
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath; Incluya lo siguiente.
if (indexPath.row == 0) [mainparent presentModalViewController:feedbackViewController animated:YES]; else [mainparent presentModalViewController:downloadViewController animated:YES];
That will modally present the required view controllers.