Domanda

I am not an iOS expert. I have a basic question, Is it possible to access/call any Objective C methods/properties from UI webview? In other words what would happen if i keep some objective C code in a HTML page and load it in UIwebview of an iOS hybrid app? Will the code execute?

È stato utile?

Soluzione

No - the code will not execute. What you're describing is an "injection" and, if it were possible, could wreak havoc in an app.

Something I've done in the past is create an app with a UIWebView container (somewhat like you're describing) then pass back a response that my code can programmatically look for and handle. This is of course possible by the fact I wrote both the app and the web back-end.

I'm sure there are other ways to do this but it has worked for me.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top