What is the default property value if I just do the following:
@property (nonatomic) UIButton *myButton;
in a non-ARC project. Is this retain or assign?
What is the default property value if I just do the following:
@property (nonatomic) UIButton *myButton;
in a non-ARC project. Is this retain or assign?
Since in non-ARC projects of any size its pretty important to see exactly whats retained and assigned or copied, I would really recommend not using that default.
Its hard to read when your looking at a class with several properties that may have many other attributes such as readonly, atomic and non atomic. getter= etc
Although its not perfect putting a #define in a constant header like
#define ASSIGN nonatomic, assign
#define RETAIN nonatomic, retain
for your most common usages can make your property definitions a little more explicit so that when you eventually catch up to writing your dealloc methods its a really quick check to see what you need to release.
Most of my property definitions looks like
@property (ASSIGN) Foo* foo;
or
@property (RETAIN) Foo* foo;
Thats what I do and it keeps the noise on property definitions down and makes the code read a little easier when troubleshooting or perfecting manual memory managed apps.