• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Run Javascript Function in iPhone App
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Is it possible to pass an object to a NIB
  • Next by Date: NSOutlineView expand-by-default with NSTreeController
  • Previous by thread: Re: Programatically Setting Delegate
  • Next by thread: NSOutlineView expand-by-default with NSTreeController
  • Index(es):
    • Date
    • Thread