nonatomic per default?
In the Xcode4 version, all my properties miss the "nonatomic" declaration, and if i add it manually via the XPROPERTY flag, the XASSIGN/XRETAIN is no longer honored. (nonatomic should be default, and
XRETAIN XPROPERTY(atomic) UIView *var
should emit
@property(xobjc nonatomic, retain) UIView *var;
instead of
@property(xobjc nonatomic) UIView *var;
I thought this was a decision of requirements, therefore I made it configurable. Just comment out the second line in xobjc4.py.
NONATOMIC = ""
# NONATOMIC = "nonatomic, "
Ah, great! It should be reflected in the README, and maybe nonatomic should be default?
atomic means that it is thread safe, if I'm not wrong. This seems to be the more 'secure' setting, even if it's slower. However, maybe it should be easier to configure. Or we could add variants like XRETAIN and XRETAIN_ATOMIC or XRETAINA. What do you think?
Yes, atomic is safer, but also slower - as I understand nonatomic is encouraged, only where thread access is used we should switch to atomic. I do like XRETAIN_ATOMIC and XASSIGN_ATOMIC - probably easier than parsing nonatomic out of XPROPERTY...