PDA

View Full Version : Xcode - Simple web browser URL issue




zmann
Nov 27, 2011, 03:34 AM
Hi,

I'm building a simple web browser in Xcode and I'm wondering how I can get my URL bar to change when a user navigates to a new page. Currently, the URL bar will only display the URL of a page if it is typed into it.

Any help would be appreciated!



jiminaus
Nov 27, 2011, 03:40 AM
Implement the WebFrameLoadDelegate method webView:didCommitLoadForFrame:.

zmann
Nov 27, 2011, 03:54 AM
How do I do that? Sorry I'm kind of new to this...

jiminaus
Nov 27, 2011, 04:39 AM
How do I do that? Sorry I'm kind of new to this...

Connect your controller (which will mostly likely be your app delegate) to the frameLoadDelegate outlet of your web view object in your .xib. Then add that method to your controller class.

If that doesn't make any sense, follow the Your First Mac App (http://developer.apple.com/library/mac/#documentation/General/Conceptual/Mac101/Articles/00_Introduction.html) tutorial and read Learning Objective-C (http://developer.apple.com/library/mac/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer).

zmann
Nov 27, 2011, 09:42 AM
I finally got it working! Thanks for the help and links :)