i receive error "too many argument to methods call, expected 1, have 2"
in the debugger, the NSLog printed the correct username and password stored in my array.
The error is telling you exactly what is wrong. The method stringByEvaluatingJavaScriptFromString wants a SINGLE parameter. You are passing it 2 parameters Your quoted string, and a value that you want to be inserted into that string. You can't do that. There are specific methods like the NSString method stringWithFormat, and the NSLog function, that can take a variable number of arguments and parse a format string, but most cannot.
The NSString method stringWithFormat takes a format string and a variable number of arguments and returns a string result. You can then pass the resulting string to your webVeiw's stringByEvaluatingJavaScriptFromString method.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
The error is telling you exactly what is wrong. The method stringByEvaluatingJavaScriptFromString wants a SINGLE parameter. You are passing it 2 parameters Your quoted string, and a value that you want to be inserted into that string. You can't do that. There are specific methods like the NSString method stringWithFormat, and the NSLog function, that can take a variable number of arguments and parse a format string, but most cannot.
The NSString method stringWithFormat takes a format string and a variable number of arguments and returns a string result. You can then pass the resulting string to your webVeiw's stringByEvaluatingJavaScriptFromString method.
Thank you Duncan! I will remember what you said! And yes, my code works now =)