2011-08-19 67 views

回答

0

在AppDelegate中,

Nsstring *textString; 

在FirstViewController.h和SecondViewController.h

YourAppDelegate *appDelegate; 

在FirstViewController.m和SecondViewController.m

在viewDidLoad中功能

appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate]; 

你可以得到文本框的文本,

appDelegate.textString = yourTextField.text; 

和SecondViewController,

NSString* textStr = appDelegate.textString; 
+0

非常感謝您拉維。你的回答非常清楚。 – realuser

0

在您的項目的appDelegate中設置一個NSString。

eg. NSString* copyStr; 

    //Now InYourFirstViewController.m 
    appDelegate.copyStr = yourTextField.text; 

    //InSecondViewController.m 
    NSString* fetchText = appDelegate.copyStr; 
相關問題