views:

39

answers:

1

Hi, I created programmatically a view that contains a navigation bar like Safari, a web view and a toolbar... In the navigation bar I put a label and two text field, one for type URL and one for type search.
But how can I use the label to show the web view page title?
I tried this code but don't work! :(

nomeSito.text = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];

How can I do this?

Thanks a lot! :)

+2  A: 

That code will work, but only if you put it in the webViewDidFinishLoad: delegate method.

St3fan
@St3fan Thanks for the answer and now it works fine ;) Now I have another little problem... Now I'd like to add some if because if the page is blank I'd like to show some word and then if the page is loading i'd like to show "Loading..." word... Can you give me an help with the if conditions? Thanks :)
Matthew