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


TJ Rogers
TJ Rogers
8,758 Points

Error in one of the Tut Vids?

First, let me start off with an observation: Amit is awesome. I've really been enjoying the iOS course, and have learned a lot so far.

But I've sort of hit a wall in understanding the getter/setter principle in properties, and I'm hoping this is because there is a small error in the video - otherwise, I'll just need to watch it another five or ten times, after which I'm sure it will click.

In the "Understanding @Property" video (in the "Refactoring into a Model" section of "Build a Simple iPhone App"), at the 1:02 mark, the getter method for:

@property(strong, nonatomic) NSArray *predictions;

is declared as:

  • (NSString *) predictions;

Should this rather be:

  • (NSArray *) predictions;

I certainly hope this is the answer, because I've spent a lot more time than I care to admit trying to figure out how NSString works as a getter method for an NSArray property.

Apologies if this seems like a dumb or obvious question, but before a few weeks ago I had never even laid eyes on a block of code, let alone attempted to understand or write it myself. So I'm REALLY new at all this.

3 Answers

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

You are right! Thanks for pointing it out. We will have our video team fix it. You sir have a keen eye for details :)

Stone Preston
Stone Preston
42,016 Points

it looks like you are right. If its getting the array of predictions, its return type should be NSArray *. Looks like there is a typo in that graphic thats used in the video.

TJ Rogers
TJ Rogers
8,758 Points

Phew! I understand @property now.