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 trialbusterlabs
9,276 PointsViewing a webpage
Challenge task 1 of 1
Open the 'url' object within the default browser using UIApplication.
NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com"];
UIApplication *application = [UIApplication sharedApplication];
/* Write your code below this line */
[application openURL:@"http://teamtreehouse.com"];
Bummer! Make sure you created an application with the correct method, and check your syntax!
3 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsYou are supposed to pass the url
object as the parameter to the openURL
method, not a string literal.
busterlabs
9,276 PointsSorry, I'm not getting it. So how does the code look like?
Dino Paškvan
Courses Plus Student 44,108 PointsNSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com"];
UIApplication *application = [UIApplication sharedApplication];
/* Write your code below this line */
[application openURL:url];
busterlabs
9,276 PointsWoah. Thanks bud