我无法在下一个选项卡viewController中获取文本字段值.我正在使用带有两个选项卡的TabBarController [英] I am not able to get text field value in to next tab viewController. I am using TabBarController with two tabs
问题描述
我有一个带有两个标签的 TabBarController
;第一个是 InputViewController
,第二个是 TableviewController
.
I have a TabBarController
with two tabs; first is InputViewController
and second one is TableviewController
.
输入视图控制器在输入文本时有两个文本字段,此后,我想在 TableviewController
(在下一个选项卡中)中接收该文本字段值.它不接收值.
Input view controller has two text fields when I enter the text, after that I want to receive that text filed value in to TableviewController
(in the next tab). It does not receive the value.
推荐答案
尝试使用此概念.....在第二个"选项卡中声明两个变量,即Tableviewcotroller.例如.
Try to use this concept..... Declare two variables in Second tab that is Tableviewcotroller.. For exa..
NSString *strname;
NSString *straddr;
@property和@synthesize都...
@property and @synthesize both...
现在,在* InputViewCotroller *选项卡中,创建并初始化TableViewcotroller对象,使用该对象访问这些变量.就像,您想要获取文本字段的值.
Now, in your *InputViewCotroller*tab, create and initialize object of TableViewcotroller, using this object, access these varibles. Like, you want to get values of textfields.
Tableviewcotroller *objTable = ........
objTable.strname = self.textName.text;
objTable.straddr = self.txtAddr.text;
在您的项目中实施这个概念...希望对您有帮助...:)
Implement this concept in your project...Hope this helps you...:)
这篇关于我无法在下一个选项卡viewController中获取文本字段值.我正在使用带有两个选项卡的TabBarController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!