如何将UITextField值从一个Nib解析为另一个Nib

时间:2009-10-14 06:44:44

标签: iphone iphone-sdk-3.0

如何将UITextField值从一个Nib文件解析为另一个,通过initWithNibName

这是第一个视图的代码

-(IBAction)testbuttonPressed:(id)sender
{
    //test.text=@"hello H R U";
    detailsViewController=[[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
    detailsViewController.address1=txtName;
    [UIView beginAnimations:@"flipping view" context:nil];
    [UIView setAnimationDuration:1];

    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationTransition: UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
    [self.view addSubview:detailsViewController.view];

    [UIView commitAnimations];
}
  • txtName在这里是UITextField。
  • 并且在FlipsideViewController中,address1是UITextField
  • 并在FlipsideViewController.m中我试图通过address1.text获取它。

现在我正在运行应用程序。第一个视图显示附加了txtName的UITextField。按钮单击新显示的视图它不是打印我在上一个视图中输入的address1.text值

0 个答案:

没有答案