【发布时间】:2015-09-01 19:43:51
【问题描述】:
所以如果我在 iOS 中(使用 Objective C,不确定这是否与 Swift 相同),例如
@property (nonatomic, copy) NSString *aString;
然后在我的代码中的一些地方
// Simple ivar access in some method
_aString = anyStringOrNil;
// Self-> ivar access in some other method
self->_aString = anyStringOrNil;
我想知道使用其中一种的区别
【问题讨论】:
-
我认为这应该回答你的问题。只需Edit您的问题,如果没有,请联系我。
-
非常感谢@JoshCaswell,我需要提高我的搜索技能!但是是的,这个实际上有答案stackoverflow.com/questions/1314173/…
标签: ios objective-c properties ivar