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

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
STAFF
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.

Thanks!