use*_*359 4 iphone xcode objective-c
可能重复:
在Objective C中使用下划线前缀属性名称
iPhone App Developer初学者:
在.h
@property (nonatomic, retain) IBOutlet UILabel *detailDescriptionLabel;
Run Code Online (Sandbox Code Playgroud)
在.m
@synthesize detailDescriptionLabel = _detailDescriptionLabel;
Run Code Online (Sandbox Code Playgroud)
我以前常常看到
@synthesize detailDescriptionLabel;
Run Code Online (Sandbox Code Playgroud)
这= _让我失望了,这是做什么的?
每个属性都由实例变量支持.该语言允许以不同的方式命名它们.通过这样做@synthesize detailDescriptionLabel = _detailDescriptionLabel;,你基本上是说使用它_detailDescriptionLabel作为属性的后备实例变量detailDescriptionLabel.如果你这样做@synthesize detailDescriptionLabel;,它会隐含地理解实例变量具有相同的名称.
| 归档时间: |
|
| 查看次数: |
997 次 |
| 最近记录: |