Add something like an implementation file:
- (IBAction)loadPage:(id)sender; { NSURL *url = [NSURL URLWithString:@"http://www.stackoverflow.com/"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; }
And add this to the header file (each line in the corresponding position):
- (IBAction)loadPage:(id)sender; IBOutlet UIWebView *webView;
Then bind the loadPage button in the interface builder,
and bind webView to UIWebView.
Reply to comment:
I created this sample project, hope this helps:
- http://dd5.org/static/iPhone_Browser_Sample.zip
Button Binding:
Right click and drag to the class where you added the code above.
Release the button. A small dark gray panel will now appear.
Then click on the loadPage: element in this panel.
If the code was added correctly, the entry should appear there.
Anne
source share