Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Blog Reader iPhone App Viewing a Web Page Implementing a UIWebView

Sakina Burch
Sakina Burch
1,853 Points

Load the previously created 'urlRequest' object within the 'webView' object.

[self.webView loadRequest : urlRequest]; not working

5 Answers

Stone Preston
Stone Preston
42,016 Points

hmm try this: i just passed with it, your code should have worked not sure whats going on with it

NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com/"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[webView loadRequest:urlRequest];
Stone Preston
Stone Preston
42,016 Points

[self.webView loadRequest : urlRequest]; wont work because you dont have a property called webView, you have a local variable called webView already created for you

UIWebView *webView = [[UIWebView alloc] init];
/* Write your code below this line */

all you have to do is reference the webView variable that was created for you at the very beginning, not a property called webView (hint: you dont have to use self since its not a property)

Sakina Burch
Sakina Burch
1,853 Points

ok still no luck. Tried several things here are two [webView loadRequest : urlRequest]; webView [loadRequest : urlRequest];

Load the 'webView' object using the method 'loadRequest' is the error message

Stone Preston
Stone Preston
42,016 Points

the first one looks like it should have worked. try

 [webView loadRequest:urlRequest];

the challenge engine is picky about spacing in method calls.

Sakina Burch
Sakina Burch
1,853 Points

No working Still getting this error message. Load the 'webView' object using the method 'loadRequest'!

Sakina Burch
Sakina Burch
1,853 Points

Thank you, thank you The second Line was where I found the error.