在iphone中自动填写注册表
我的数据数组中有来自webservices的数据,我想在用户输入电子邮件时自动填充所有数据,它应该加载所有文本字段中的所有数据,我该怎么做?请帮忙在iphone中自动填写注册表,iphone,ios,uitextfield,Iphone,Ios,Uitextfield,我的数据数组中有来自webservices的数据,我想在用户输入电子邮件时自动填充所有数据,它应该加载所有文本字段中的所有数据,我该怎么做?请帮忙 -(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { GET_DBHANDLER if (dataArray.count==0) {
-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
GET_DBHANDLER
if (dataArray.count==0) {
NSLog(@"sasas");
}
else
{
dataArray = [dbHandler getUserDetails:txtEmail.text];
for (userDC *user in dataArray) {
txtFirstName.text = user.firstName;
txtSurName.text = user.surName;
txtTelephone.text = user.telephone;
txtMobile.text = user.mobile;
txtBusinessName.text = user.businessName;
txtBusinessAddress.text = user.business_address;
txtWebSite.text = user.website;
txtLinkedIn.text = user.linkedin;
txtFaceBook.text = user.facebook;
txtTwitter.text = user.twitter;
txtAppUserName.text = user.app_username;
txtAppPassword.text = user.app_password;
txtNetworkUserName.text = user.network_username;
txtNetworkPassword.text = user.network_password;
txtBNIUserName.text = user.bni_username;
txtBNIPassword.text = user.bni_password;
}}
}
是否有任何按钮操作、键盘调整或其他任何方式来知道在textfield中输入的数据是否已完成?不,它应该来自textfield在输入电子邮件后,您想填充其余的文本字段,对吗?是的,正是我想要的,然后告诉我一件事,我们如何知道电子邮件文本是否已完全填充?
-(BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (textField.tag == yourEmailTextField.tag)
{
if([textField.text isEqualToString:yourRequiredEmailID])
{
for (userDC *user in dataArray) {
txtFirstName.text = user.firstName;
txtSurName.text = user.surName;
txtTelephone.text = user.telephone;
txtMobile.text = user.mobile;
txtBusinessName.text = user.businessName;
txtBusinessAddress.text = user.business_address;
txtWebSite.text = user.website;
txtLinkedIn.text = user.linkedin;
txtFaceBook.text = user.facebook;
txtTwitter.text = user.twitter;
txtAppUserName.text = user.app_username;
txtAppPassword.text = user.app_password;
txtNetworkUserName.text = user.network_username;
txtNetworkPassword.text = user.network_password;
txtBNIUserName.text = user.bni_username;
txtBNIPassword.text = user.bni_password;
}
return NO;
}
}
return YES;
}