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

Ben Littler
Ben Littler
750 Points

No output in variable lesson?

Hi, I am just starting the iOS track, and during the first lessons where you type code directly into the lesson, I do not seem to be getting any output when I click "preview". Although I was able to pass the lesson, I don't understand why clicking preview seems to show me no results. I tried both Chrome and Safari... am I doing something wrong?

2 Answers

Mike Bronner
Mike Bronner
16,395 Points

Preview only works in certain occasions. I think it is there if you want to manually do some debugging and create output of your own, if you are having trouble solving the challenge. I would say 75% of the time preview isn't affected by the challenge itself.

Ben Littler
Ben Littler
750 Points

Great, thanks for the explanation, Mike. Another newbie question - these challenges seem to assume I have some knowledge beyond what the previous videos have shown me. I do not. For example, the current challenge states

"Declare an array of type 'char' called "letters" with a size of 2. Assign the variable "alpha" as the first element of the array "letters".".

There was no explanation given of use of sizes... where do I find the required information to complete this challenge? I'm not really sure what the challenge requires for completion. I have been able to get by by checking the forums and seeing what others have done, but surely there is another route?

Thanks again.

Ben Littler
Ben Littler
750 Points

Nevermind I'm dumb. By "size of 2" they mean an array with 2 variables. I am a bit confused about how to assign the variable alpha as the first element, however. I thought char variables are only a single character?

Mike Bronner
Mike Bronner
16,395 Points

I would use google in those cases. In your example, search for ios create fixed size array. You will generally find lots of posts, and Apple SDK resources covering the specific issue.

Mike Bronner
Mike Bronner
16,395 Points

An array is not a string. So adding both variables to the array will not result in a string. Think of an array as a chest of drawers. In your case you have two drawers, and are putting the bucket labeled alpha in the first drawer, and the bucket labeled beta in the second drawer. Each bucket holds a char (imagine a wooden toy alphabet cube with the letter on it).

So in the end you can't make a word out of the letter blocks, because they are in separate drawers.

Mike Bronner
Mike Bronner
16,395 Points

A string would be if you created a third bucket as a string and dumped the contents of both alpha and beta buckets into it.