Re: Run Javascript Function in iPhone App
Re: Run Javascript Function in iPhone App
- Subject: Re: Run Javascript Function in iPhone App
- From: Izidor Jerebic <email@hidden>
- Date: Sat, 5 Dec 2009 17:12:10 +0100
Hi,
this has nothing to do with javascript. Your problem is how to get the
string out of UITextField.
'sender' is UITextField, which does not have the method -stringValue
like NSTextField. Look at the documentation of UITextField. You should
use property 'text' instead.
izidor
P.S. You should ask the questions on mailing lists, so that others can
benefit from answers.
On 5.12.2009, at 14:59, Philip Juel Borges wrote:
Hi.
You previously helped me out with calling a javascript function so
that I could enter a number in an NSTextField and then go to the
corresponding link in WebView. That workds great.
Now, how do I do that with an UIWebview and UITextField? I've
searched and tried, but I can't get it to work.
My method is this:
-(IBAction)goToPage:(id)sender {
/* call the javascript function named goToPage */
[webView stringByEvaluatingJavaScriptFromString:[NSString
stringWithFormat:@"goToPage('%@');", [sender stringValue]]];
}
This doesn't work in the iPhone SDK environment. I get an error on
sender stringValue.
In Interface Builder I connect the UITextField outlet to the
UITextField object and the goToPage action also to the UITextField.
Like I would do for Mac app.
Do you know how to get this to work? I appreciate any help or
direction in the right way.
--Philip
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden