views:

50

answers:

2

Hey all,

i try to modify my didSelectRowAtIndexPath Method to use my AddView also for editing (only with filled textfields). But it is not working! I just enter edit mode, check if(self.editing) and do something like:

   if (self.editing) {
        AddViewController *viewController = [[AddViewController alloc] 
                                             initWithNibName:@"AddView" bundle:[NSBundle mainBundle]];
    //get selected Object  
    User *userEdit = [[User alloc] init];
    userEdit = [self.users objectAtIndex:indexPath.row];
    viewController.user = userEdit;
    [viewController setEditUser];

    [self.navigationController pushViewController:viewController animated:YES];
    [viewController release];
    //deselect Row after navigate back
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

What am I doing wrong? I also try to send the User object like [viewController setEditUser:editUser] but this is also not working, so i tried it with init.

My setEditUser Method looks like (in the view)

- (void)setEditUser{
self.userTitle.text = self.user.title; //this is not working!!! ?????
NSLog(@"blub %@", self.user.title); //this is working!!!!

}

Thanks for your Help

A: 
pfandrade
thanks, im able to do editing :) But im not able to send data to my view (textfields are not displaying the values, NSLog does)
phx
A: 

It works if i do the textfield value setting at

- (void)viewDidAppear:(BOOL)animated{
self.userTitle.text = self.user.title;}
phx