I was wondering what is the correct way to write synthesised properties for primitive data types (like bool) when ARC is enabled.
I used to use this before ARC:
@property(assign) bool isOn;
But it is my understanding (maybe wrong) that you shouldn’t use assign when ARC is enabled. I tried replacing this with weak but I get the error –
Property of “weak” attribute must be of type object.
Should I continue to use assign?
Assignis fine. ARC stands for “Automatic Reference Counting”, and primitive data types do not have reference counts.Weakfailed because there is no object, nor any references for ARC to manage.