0

I've managed to read some values into a table view and display them in the Master View of a SplitViewController.

What I would like to do is to tap on a row of the Master View and display the details on the detailViewController but in a TableView.

When I tap on the row in the MasterView table, I can't seem to get the detail to populate the detailview TableView.

Any suggestions?

Thanks in advance.

leppie
  • 115,091
  • 17
  • 196
  • 297
Neha
  • 681
  • 2
  • 9
  • 15
  • Do i need to take a separate "Ipad view with Controller" type file for the TableView (which is on the detailview) on which i want to display the detailed information or i need to create the subclass for this tableview in the detailcontroller.xib.cs file itself? Please help me out. – Neha Dec 15 '10 at 12:34

3 Answers3

0

Here's what you need to do:

  • Add an outlet to your master view controller which is a link to your detail view controller
  • Connect this outlet (either in Interface Builder or in code)
  • Add properties to your detail view for the values you're interested in displaying
  • in your implementation of tableView:didSelectRowAtIndexPath: retrieve the data for the selected row and set the corresponding properties in your detail view
Denis Hennessy
  • 7,243
  • 4
  • 25
  • 31
  • Hi Denis, Can you be plz a bit more specific and clear as i am a novice in this field. Thanks. – Neha Dec 15 '10 at 12:59
0

Read this basic tutorial.

http://doronkatz.com/ipad-programming-tutorial-hello-world

Go through the sample code and see what you are doing wrong or missing

EDIT: its a tutorial on splitViewController.

Bourne
  • 10,094
  • 5
  • 24
  • 51
0

may be this code is help for you

in table View .m file

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

if(self.dvController == nil){
    DetailsViewController *viewControoler = [[DetailsViewController  alloc]initWithNibName:@"detailsViewController" bundle:[NSBundle mainBundle]];
    self.dvController = viewControoler;
    [viewControoler release];
}

DocumentNavController *docObjNew = [appdelegate.noteArray objectAtIndex:indexPath.row];

[docObjNew hydrateDetailViewData];
//
dvcontroller.noteObj = docObjNew;  //noteobj reference  from in DetailsViewController.m file DocumentNavController *noteObj;

dvcontroller.currentindex = indexPath.row;


[self.navigationController pushViewController:self.dvController animated:YES];

self.dvController.title = [docObjNew noteTitle];
[self.dvController.noteTitelFiled setText:[docObjNew noteTitle]];
[self.dvController.notediscView setText:[docObjNew noteDisc]];



}

in table view .h file

@interface DocumentTableViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource> {

UITableView *documenttableView;

evernoteAppDelegate *appdelegate;
UINavigationController *navControll;
DetailsViewController *dvcontroller;
DocumentNavController *docNavContro;

//NSIndexPath *selectIndexPath;


}

@property (nonatomic, retain)DetailsViewController *dvController;
@property (nonatomic, retain)DocumentNavController *docNavContro;
@property (nonatomic, retain)UITableView *documenttableView;

in DetailsViewController.h file

UITextField *noteTitelFiled;
UITextView *notediscView;

DocumentNavController *noteObj;

@property (nonatomic, retain)IBOutlet UITextField *noteTitelFiled;
@property (nonatomic, retain)IBOutlet UITextView *notediscView;
@property (nonatomic, retain)DocumentNavController *noteObj;
nlg
  • 161
  • 1
  • 8