Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push/Present Modal View Controller

I have a table in my view controller (let's call it TVC1). I have rows in TVC1 that are used so the user can input some more data in addition to the data on TVC1. So, when someone taps a specific row in TVC1, it will show another view controller (let's call it TVC2). However, when TVC2 is shown, all of the data in TVC1 is cleared. How can I save the data in TVC1? Should I do it through the app delegate?

        DescriptionInputViewController *descriptionController = [[DescriptionInputViewController alloc] 
                                                             initWithNibName:@"DescriptionInputView" 
                                                             bundle:nil];

    [self presentModalViewController:navController animated:YES];
    [self.navigationController pushViewController:descriptionController animated:YES];
    [descriptionController release];
like image 394
skylerl Avatar asked Dec 13 '25 12:12

skylerl


1 Answers

In your code, you should be calling:

[self presentModalViewController:descriptionController animated:YES]

descriptionController is the view controller you are displaying.

like image 177
rekle Avatar answered Dec 16 '25 07:12

rekle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!