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

Stuck on 1st code challenge :(

I'm trying to pass the first code challenge but it is not taking my code, I was forced to cheat on stackoverflow and still won't take any of the following lines I tried...

NSString* welcomeMessage= @"Welcome to Life Leveler";
NSString* welcome= @"Hello";
NSString* welcome = @ "Hello";
NSString *welcome= @"Hello";
NSString* myString= @"testing";   <- direct copy from stackoverflow

Ok I think this code challenge is broken, I just encountered the same test in the "Classes and Objects" stage

- (IBAction)buttonPressed:(UIButton *)sender {
    NSString *myString = @"My name is Leon";
    self.predictionLabel.text = @"Definately yes";
    self.predictionLabel.text = myString;
}

The above code works in the test app view, however NSString *myString = @"My name is Leon";

Does not work in the code challenge.

2 Answers

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

Leon Gaban The instructions on the very first code challenge say: "Create a string named 'treehouse' with a value of 'Treehouse'."

Oh thanks!

/faceplam... I just remember hearing from the video go make a string, I just missed the instructional copy.

Liking the course otherwise :)

Hey Leon,

I had trouble with this at first too:

Directions say do this: create a new string called aString that contains the text "Objective-C is fun".

The code challenge is setup to already encompass most of the other variables so all you need to do is create the string to pass the challenge.

NSString *aString = @"Objective-C is fun";

Should do the trick.