NSString *usernameJS = [NSString stringWithFormat:@"document.getElementById('account').value ='%@'", username];
NSString *passwordJS = [NSString stringWithFormat:@"document.getElementById('password').value ='%@'", password];
[self.logInWebView stringByEvaluatingJavaScriptFromString: usernameJS];
[self.logInWebView stringByEvaluatingJavaScriptFromString: passwordJS];
如果要取值的話只要執行@"document.getElementById('account').value" 就可以囉另外密碼除存在本機端可透過 SFHFKeychainUtils 這程式去做密碼的控管與保護
詳情細節請參考
http://stackoverflow.com/questions/4772341/is-it-possible-for-a-uiwebview-to-save-and-autofill-previously-entered-form-valu