views:

65

answers:

1

Hi, I'm pretty new to iPhone application development and I'm doing well so far. But at one point my App doesn't do what it is intend for... It's a tableview based app and i'm pushing a new controller onto the stack to get some Userinput, but when the controller is popped again the data is somehow gone. Perhaps I've missunderstood something with the pointers??

rootviewcontroller.m:

edit = [fields objectAtIndex: indexPath.row];
listView.element = edit;
[self.navigationController pushViewController: listView animated:YES];

ListView.m:

element.value = [list objectAtIndex: indexPath.row];
[self.navigationController popViewControllerAnimated:YES];

so what am I doing wrong?

Thanks for your help

edit:

the value field is shown in the tableview with the cellForRowAtIndexPath method:

if (indexPath.section == 0) {
UILabel *title = (UILabel*) [cell viewWithTag:1];
UILabel *detail = (UILabel*) [cell viewWithTag:2];
ListElement *l = [fields objectAtIndex: indexPath.row];
title.text = l.name;
detail.text = l.value;
A: 

If the data is "gone" means "it's not shown after returning to root view" it can probably be fixed by

- (void) viewWillAppear:(BOOL)animated
{
   [self.tableView reloadData];
}

put into RootViewController.

Kai
Thanks that helped =)
Red_Hawk