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 trialJaime Hernandez
3,854 PointsAdapting Data for Display - Challenge 2 or 3 - Help...
Ok, I'm not really sure why I get a compilation error, I enter the following code:
Create an instance of NSData named 'data' with the previously created 'url' object.
-> Bummer! Compilation Error! Make sure you are calling 'dataWithContentsOfURL'. <-
images.m
NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com/assets/homepage/logo.png"];
NSData *data [NSData dataWithContentsOfURL:url];
4 Answers
Stone Preston
42,016 PointsNSData *data [NSData dataWithContentsOfURL:url]
you are missing an = it looks like. could be the issue
Jaime Hernandez
3,854 PointsDoh!
Thanks!
Stone Preston
42,016 Pointsno problem
Martin Greenberg
1,434 PointsNSData *data = [NSData dataWithContentsOfUrl:url];
This is what I'm putting in and I'm getting a compilation error as well.
Stone Preston
42,016 PointsNSData *data = [NSData dataWithContentsOfURL:url];
the letters URL on the end of the method name should all be capitalized. you currently have
NSData *data = [NSData dataWithContentsOfUrl:url];
which uses a capital U but lower case r and l, which is why its not working
onurtekin
7,346 PointsSomething wrong there i think. Keeps giving me the same error.
NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com/assets/homepage/logo.png"];
NSData *data = [NSData dataWithContentsOfURL:url];
This is the error i get: Looks like you have not defined 'data'
Adham Gad
9,899 PointsOnur Tekin same here ! it gives me the same error
Stuart King
2,218 PointsI have this same issue
NSURL *url = [NSURL URLWithString:@"http://teamtreehouse.com/assets/homepage/logo.png"];
NSData *data = [NSData dataWithContentsOfURL: url];