I have trouble accomplishing something that sounds very simple. Using Interface Builder, I created a UIWebView object. Next, I created a new controller - HomeViewController and assigned it to the WebView under "NIB Name" property. Next I need to load a web site (let's say http://google.com) into that WebView when user accesses that view. I am not able to find any examples on how to actually accomplish this. Please provide a code example. Sorry about the newbie question. I did RTFM, but no luck.
A:
try this :
[webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]]]; // webview - your Uiwebview object
Reena
2010-07-14 06:04:13
Can you please provide context for this? Where does this go and where does "webview" object come from? This is a nib-based UIWebView object, so how do I reference it in code?
2010-07-14 17:07:51
Create IBoutlet for UiWebview in your .h file and connect it in NIB file.eg. IBoutlet UiWebview *webview;
Reena
2010-07-15 03:46:58