Possible Duplicate:
Prefixing property names with an underscore in Objective C
iPhone App Developer Beginner here:
in .h
@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;
in .m
@synthesize detailDescriptionLabel = _detailDescriptionLabel;
I’m used to seeing
@synthesize detailDescriptionLabel;
the = _ is throwing me off, what is this doing?
Each property is backed by an instance variable. The language allows for them to be named differently. By doing
@synthesize detailDescriptionLabel = _detailDescriptionLabel;, you’re basically saying that use_detailDescriptionLabelas the backing instance variable for the propertydetailDescriptionLabel. If you just do@synthesize detailDescriptionLabel;, it implicitly understands that the instance variable has the same name.