I've created a @property
of UIColor
,
@property (nonatomic) UIColor *color;
and then I tried to synthesize it:
@synthesize color = _color;
but I receive an error:
ARC forbids synthesizing a property of Objective-C object with unspecified ownership or storage attribute
What does that mean?
All I'm trying to do is to create a property for a UIColor
object which changes color.
Change your property declaration to:
@property (nonatomic,strong) UIColor *color;
so that ARC knows it should be retained. This would have compiled without strong
before ARC but it would be dangerous since the default was assign
and the color would have been released unless it was retained elsewhere.
I would highly recommend the WWDC2011 video about ARC.
You have to specify either strong
or weak
storage in the property declaration (next to nonatomic
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With