This expression doesn’t seem to work. It’s with a Mac application, not an iPhone app.
[[mainWebView mainFrame] stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"document.getElementById('username').value='%@';document.getElementById('password').value='%@';", [ebuddyidField value], [passwordField value]]];
You need to send your
stringByEvaluatingJavaScriptFromString:message to the WebView, not to its main frame.Also, assuming that
ebuddyidFieldandpasswordFieldare NSTextFields (the latter possibly an NSSecureTextField), they do not respond to avaluemessage. The closest message they do respond to isobjectValue, though you more probably wantstringValue.The compiler should have given you warnings for all three problems. Go to your Build Results window and fix every warning. Then turn some more on and fix those, too. Your application will be much more stable, more robust, and less leaky for it.