Reputation: 8144
I want to have a strong readonly property. When I use this code:
@property (strong, nonatomic, readonly) NSString *test;
I get a warning: "Property attributes 'readonly' and 'retain' are mutually exclusive". How can I solve this warning?
Upvotes: 3
Views: 230
Reputation: 119031
Create a property in your continuation category which redefines the variable as readwrite
:
@property (strong, nonatomic, readwrite) NSString *test;
Now, publicly the property is read only, but privately you can write it. The compiler will generate the methods you need and allow you to call them.
Upvotes: 3