On 28.9.2009, at 11:24, Philip Juel Borges wrote:


You need to execute full statement:

NSString *command = [NSString stringWithFormat:@"goToPage( '%@' );", [sender stringValue]] ;
[theWebView stringByEvaluatingJavaScriptFromString:command] ;


Again, there are no arguments. How could it work? Try this:

[[theWebView windowScriptObject] callWebScriptMethod:@"goToPage" withArguments:[NSArray arrayWithObject:[sender stringValue]]];

Thanks for your help. But it doesn't work yet. I'm still new to cocoa, so still learning. I connected the IBAction to the NSTextField and the test.html is loaded on launch. but nothing happens. Am I missing something with the NSTextField or something else?

The above code should work if you have all connections set up correctly.
The simplest way to debug is to just print out what is happening and check your debug/run console for output. Put this in your methods and see what happens when you press enter/return in your textfield:

NSLog( @"theWebView = %@, sender = %@, stringValue = %@", theWebView, sender, [sender stringValue] ) ;


Regards,

izidor

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to