Welcome to the Treehouse Community
Looking to learn something new?
TJ Rogers8,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.
Amit BijlaniTreehouse 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 Preston42,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.