我在某个外国代码中读到了一些东西,我想检查一下我的假设:
@synchronized(self)
在设置属性时用于摆脱self
前缀。
因此,在我的下面的示例中,我设置了实例的strText
,而不仅仅是一个局部变量,对吗?
- (void)myfunction{
NSString * strText = @"var in function";
@synchronized(self)
{
strText = @"var class (self.strText)";
}
}