.hの内部:
@interface MyController : UIViewController<UITextFieldDelegate> {
IBOutlet UITextField *phonenum;
IBOutlet UITextField *email;
}
@property (nonatomic, retain) UITextField *phonenum;
@property (nonatomic, retain) UITextField *email;
-(IBAction) btnClicked: (id) sender;
@end
.mの内部:
-(IBAction) btnClicked: (id) sender{
NSString *str = [[NSString alloc]init];
NSLog(@"str=%@",str); //this contains valid value
email.text=str; /// does not set the value
[[self email] setText: str]; // does not set the value
}
NSString である変数 str を使用して UITextField 値を設定しない場合、何が間違っていますか? これはある種のインターフェイス ビルダーの設定ですか? ファイル所有者への委任リンクがあります。