我从文本字段中的选择器中选择日期,然后单击发送按钮进行肥皂调用。但文本字段返回 null。肥皂的消息是
< date1 >null< date1 >
< date2 >null< date2 >
。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];
}