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

Bradley White
Bradley White
21,285 Points

first code challenge on building ios app

I try to create a new string exactly like the video's example and it keeps telling its wrong. What the heck is the deal?

9 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Can you paste your code in here? If you indent it with four spaces it will show up formatted as code, like this:

NSString ... <rest omitted!>
Bradley White
Bradley White
21,285 Points

NSString *myString = @"iPhone island";

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Ah...you need to follow the instructions explicitly. The instructions for that step specify what the variable name and value should be, and they have to match exactly to pass.

Bradley White
Bradley White
21,285 Points

I tried using the name of the .mm thing above it and it still didn't work. What is the answer suppose to be so I can see my error?

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

We don't like posting the exact answers in here so that people don't come here in the future just looking for answers without the discussion, but hopefully this is explicit enough to get you there. The instructions from the page are:

Create a string named 'treehouse' with a value of 'Treehouse'.

Your line of code:

NSString *myString = @"iPhone island";

Your string is named 'myString' and your value is 'iPhone island'. So just swap out those with what's specified in the instructions and it will pass for you.

Bradley White
Bradley White
21,285 Points

Thank you!!!!!!!!! That clears it up!

I did the same thing, didn't notice the instructions right above!

I had the same trouble with it not accepting, I found that I was writing the first part wrong. I was trying to submit it with "NSSTRING" instead of the correct "NSString", also I wasn't placing a space between after *mystring and the "=" and then the "mycontent", after fixing that I got it to accept.

i write all right as it is written in the video and its saying its wrong i dont know what to do

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Hi Elliot, make sure you follow the instructions for the Code Challenge and don't just type what was in the video. The instructions for that step specify what the variable name and value should be, and they have to match exactly to pass.