View Single Post
  #3 (permalink)  
Old February 24th, 2013, 11:08 PM
gbacklin gbacklin is offline
Wrox Author
Points: 362, Level: 6
Points: 362, Level: 6 Points: 362, Level: 6 Points: 362, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts

Originally Posted by RonMcMahon View Post
I picked up this book yesterday after struggling along with a couple of other authors. Your writing style and comprehensive definitions of what is where and how things work is a perfect match for my learning style.

As you may have expected, I stumbled once I hit Chapter 4 with the missing @synthesize instructions. I haven't found any reference to @synthesize in the index either, so perhaps coverage of this is completely missing from the book(?)

If this is so, could you be so kind as to post a definition and description of @synthesize in the same style as is used in the book so that I can wrap my mind around the how and why of @synthesize? (VERY OLD Basic developer here...)

If there is a definition already in the book, feel free to tell me what page to find it on.

Much appreciated!
Hi Ron,

in the old days (like in the NeXTSTEP days) when you declared a variable in the interface (.h) file, you would manually code your setter and getters.

When this book was written you would type:
@property (strong, nonatomic) NSString *value;

in the interface (.h) file and then in the implementation (.m) file you would type:

@synthesize value;

This would automatically give you setters and getters:

[self setValue@"some string"];

NSString *myValue = [self value];

Thus you would not have to write the setters and getters if you used @property/@synthesize

In the latest Xcode and iOS 6.x you no longer have to include the @synthesize anymore if you use the @property.

Is that as clear as mud ?

Reply With Quote