相关疑难解决方法(0)

通过iOS中的邮政编码自动填充城市和州

我认为我有三个文本域.1.邮政编码,2.城市和3.州.

如何从iOS中的邮政编码自动填充城市和州的字段?

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    NSString *currentString = [textField.text stringByReplacingCharactersInRange:range withString:string];
    int length = [currentString length];
    if(length > 5)
    {
        return NO;
    }
    if(length == 5)
    {
        [self getCityAndState];
    }
    return YES;
}

- (void) getCityAndState
{
    //How to use google (or any) api to autofill city and state in objective - c?
}
Run Code Online (Sandbox Code Playgroud)

objective-c google-api ios

12
推荐指数
4
解决办法
8679
查看次数

标签 统计

google-api ×1

ios ×1

objective-c ×1