Here, both properties are declared as NSString. By default, the property uses an instance variable of the same name, but you can override it with the equals sign. The @sythesize directive reads the information from the @property directive to determine the type is NSString.
by Scott Stevenson — Oct 27
Why isn't the property written as: @property location?
A property doesn't necessarily have to be backed by an instance variable with the same name, or an instance variable at all.
@interface Person : NSObject { NSString *realLocation; NSString *fakeLocation; } @property NSString *location1; @property NSString *location2; @end @implementation Person @synthesize location1=realLocation; @synthesize location2=fakeLocation; @end
Here, both properties are declared as NSString. By default, the property uses an instance variable of the same name, but you can override it with the equals sign. The @sythesize directive reads the information from the @property directive to determine the type is NSString.