可能重复:
How does an underscore in front of a variable in a cocoa objective-c class work?财产申报的帮助
我所看到的,他们使用下面的编码风格财产申报网上有许多例子:
@interface Book : NSObject
{
NSString *_title;
}
@property (nonatomic, retain) NSString *title;
@end
在实施:
@implementation Book
@synthesize title = _title;
@end
问题是我们为什么使用下划线?