推/现模态视图控制器 [英] Push/Present Modal View Controller

查看:195
本文介绍了推/现模态视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的视图控制器(我们称之为TVC1)有一个表。我在TVC1中有行使用,所以用户可以输入一些更多的数据除了TVC1上的数据。因此,当有人点击TVC1中的特定行时,它将显示另一个视图控制器(我们称之为TVC2)。然而,当显示TVC2时,TVC1中的所有数据被清除。如何在TVC1中保存数据?

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];


推荐答案

p>

In your code, you should be calling:

[self presentModalViewController:descriptionController animated:YES]

descriptionController是您正在显示的视图控制器。

descriptionController is the view controller you are displaying.

这篇关于推/现模态视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆