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 trial

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.