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

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

This is my code, but its not working??? any answers.

UIWebView *webView = [[UIWebView alloc] init];

/* Write your code below this line */

NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com/"];

NSURL *urlRequest = [NSURLRequest requestWithURL:url];

[webView loadRequest:urlRequest];

4 Answers

i figured it out, in the line of code before i had: NSURL *urlRequest = [NSURLRequest requestWithURL:url];

it needed to say

NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];

thanks for your help.

Patrick Donahue
Patrick Donahue
9,523 Points

Good job - i feel silly missing that!

Patrick Donahue
Patrick Donahue
9,523 Points

Remove the "/" at the end of the URL.

even without the "/" i get this message:

Bummer! Create a NSURL object using the method 'URLWithString'!

Patrick Donahue
Patrick Donahue
9,523 Points

Weird. Try adding the www? I am not on a computer to try it out.