改變我有這樣的代碼:如何將文本框的文本從另一種觀點認爲
ViewController .h
@property IBOutlet UITextField *field;
ViewController .m
@synthesize field;
ViewControllerTwo .h
#import "ViewController.h"
{
ViewController *ViewCont;
}
-(IBAction)changeTextField
ViewControllerTwo .m
#import "ViewController.h"
-(IBAction)changeTextField{
viewCont.field.text = @"hello";
}
的問題是,這是行不通的,雖然它並沒有給我任何錯誤。有誰知道我做錯了什麼?
確實實例化類。你的回答非常棒! – adr 2012-04-04 09:02:29