【发布时间】:2011-07-31 17:54:53
【问题描述】:
可能重复:
How does an underscore in front of a variable in a cocoa objective-c class work?
谁能指出下划线使用的解释,我一直认为它们用于强调您正在访问 iVar [_window release]; 而不是通过 setter/getter 方法访问 iVar [[self window] release]; 或[self.window release];我只是想验证一下我的理解是否正确。
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UILabel *markerLabel;
@synthesize window = _window;
@synthesize markerLabel = _markerLabel;
【问题讨论】:
-
这里曾经指向另一个骗子,这也很有趣*.com/questions/3521254/…