I have a class with readwrite int properties:
@interface PlayScene : UIView
@property (readwrite, assign) int Figure1;
@property (readwrite, assign) int Figure2;
@property (readwrite, assign) int Figure3;
But when I try to change the value of the properties, an error occurs:
[self Figure1] = 1;
assigning to 'readonly' return result of an Objective-C message not allowed
What is the problem?
wrong syntax!
call
[self setFigure1:1];
or
self.Figure1 = 1;
(it's the same, thanks to @synthesize [i hope you did add a synthesize]!)
And: BTW: you might use lowercase-camelcase for your instance variable. It's kind of global-common. :)
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