I have a few questions about variable/object declaration in Objective-C, and am hoping to understand a few things better.
I know that giving a variable an
@property
declaration allows you to access it from other classes, if you don't plan to use it outside of it own class, is there any use in this?I often see in sample code variables and objects are only declared using
@property
and not directly in the@interface
. Why?I also see people when using
@synthesize
, do something likevar = _var;
. How come?When referencing objects and variables, is there any reason, for example to do
self.var.
rather thanvar.
?