If you use UIWebView and would like to automatically fill in the username and password (or any other text input fields), you could do so by executing Javascript on the webview.
I first learnt about this from stackoverflow, and has edited slightly.
The technique is to implement UIWebViewDelegate and execute some Javascript in webViewDidFinishLoad.
1234567891011121314151617
-(void)webViewDidFinishLoad:(UIWebView*)webView{// Auto fill the username and password text fields, assuming the HTML has// <input type="text" name="username"> and// <input type="text" name="password">NSString*savedUsername=[[NSUserDefaultsstandardUserDefaults]objectForKey:@"USERNAME"];NSString*savedPassword=[[NSUserDefaultsstandardUserDefaults]objectForKey:@"PASSWORD"];if(savedUsername.length!=0&&savedPassword.length!=0){// Create js stringsNSString*loadUsernameJS=[NSStringstringWithFormat:@"var inputFields = document.querySelectorAll(\"input[name='username']\"); \ for (var i = inputFields.length >>> 0; i--;) { inputFields[i].value = '%@';}",savedUsername];NSString*loadPasswordJS=[NSStringstringWithFormat:@"var inputFields = document.querySelectorAll(\"input[name='password']\"); \ for (var i = inputFields.length >>> 0; i--;) { inputFields[i].value = '%@';}",savedPassword];// Runs the JS[self.webviewstringByEvaluatingJavaScriptFromString:loadUsernameJS];[self.webviewstringByEvaluatingJavaScriptFromString:loadPasswordJS];}}