calling javascript objective-c without visible uiwebview

I want to call javascript functions from my objective-c. This for iphone. I understand how the call to the javascript function is done with this line

But I dont actually want a webview to be seen or used as part of the UI. So can I just create an instance of it right before calling the method above in some way.

I have tried:

but nothing seems to happen. So is there a method similar to the above that I am meant to use.

add the webview in your controller’s view in order to run the javascript. it won’t be visible since it has zero height & width.