0

I am developing a master detail view application for iPad. All I have done so far is to get the data populated in my Master view. All these are images which are stored in NSMutableArray. When a user clicks on any row, The corresponding image should appear in the detail view.

I saw so many examples on this and I figured out that I need to make changes in didSelectRowAtIndexPath and in setDetailItem and configureView. But I don't know what exactly I have to do in these methods. Also, my Master view should be hidden when I select any row in it. This is not happening. Also, in iPad master detail template, there is no seague between the Master view and detail view. I tried creating one but then the data is being displayed in Master view only and not in detail view. I want the detail view to be updated. Please let me know if anyone know how to get this done.

4

1 に答える 1

0

詳細ビューに渡したいパラメータの値を取得するだけです。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (!self.detailViewController) {
        self.detailViewController = [[[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil] autorelease];
    }
   // Here you need to pass data object that you want to show in detail view Controller
    // Object contains value of particular index in tableView.
    self.detailViewController.detailItem = object;
    [self.navigationController pushViewController:self.detailViewController animated:YES];
}
于 2013-01-23T19:52:20.187 に答える