Assigning to 'readonly' return result not allowed, but property is declared “readwrite”

前端 未结 1 580
别跟我提以往
别跟我提以往 2020-12-18 06:14

I have a class with readwrite int properties:

@interface PlayScene : UIView

@property (readwrite, assign) int Figure1;
@property (         


        
1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 06:59

    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. :)

    0 讨论(0)
提交回复
热议问题