Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I thought I had this one.

On step 3 of this code challenge I'm supposed to "Load the previously created 'urlRequest' object within the 'webView' object."

I got this message: Bummer! Load the 'webView' object using the method 'loadRequest'!

What's wrong with my code?

UIWebView *webView = [[UIWebView alloc] init];
/* Write your code below this line */
NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com/"];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[self.webView loadRequest:urlRequest];

2 Answers

Michael Curtis
Michael Curtis
6,684 Points

Try dropping self as there is no indication that this object is a property and so may not be accessible via dot notation.

[webView loadRequest:urlRequest];

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

Sorry I didn't update this post, I searched the forum and found a post that helped me. Thanks for your help any way.