我在文本框選定的日期從選擇器,然後單擊肥皂call.But文本框返回發送按鈕null.The肥皂的消息是爲什麼Uitextfield返回null?
<日期1>空<日期1>
<日期2>空<日期2>
.H
@property (nonatomic, retain) IBOutlet UITextField *Date1;
@property (nonatomic, retain) IBOutlet UITextField *Date2;
.M
@synthesize Date1,Date2;
-(void) viewWillDisappear:(BOOL)animated
{
[Date1 resignFirstResponder];
[Date2 resignFirstResponder];
}
- (void)textFieldDidBeginEditing:(UITextField *)textField{
Date1 = textField;
Date2 = textField;
[self addInputViewToTextField:textField];
[self addInputViewToTextField:textField];
}
- (void)textFieldDidEndEditing:(UITextField *)textField{
Date1 = nil;
Date2 = nil;
}
- (void)viewDidUnload {
[self setDate1:nil];
[self setDate2:nil];
[super viewDidUnload];
}
謝謝你的鷹眼:) – Mhmt