【发布时间】:2011-06-06 23:18:12
【问题描述】:
我读过一些外国代码,我想检查一下我的假设:
@synchronized(self) 用于在设置属性时去掉self 前缀。
所以在下面的示例中,我设置了实例的strText,而不仅仅是一个局部变量,对吧?
- (void)myfunction{
NSString * strText = @"var in function";
@synchronized(self)
{
strText = @"var class (self.strText)";
}
}
【问题讨论】:
标签: objective-c synchronized self declared-property