5
我有readwrite
int
屬性的類:指定爲「只讀」返回結果不準,但屬性聲明「讀寫」
@interface PlayScene : UIView
@property (readwrite, assign) int Figure1;
@property (readwrite, assign) int Figure2;
@property (readwrite, assign) int Figure3;
但是當我嘗試改變屬性的值,錯誤發生:
[self Figure1] = 1;
'只讀' 返回的結果分配給一個Objective-C消息的不允許
問題是什麼?
請包含您用來「嘗試更改其值」的代碼。 – 2012-04-24 18:08:52
和方法一樣,所有@property聲明都應該始終以小寫字母開頭。 – bbum 2012-04-24 18:13:18
好的我會記住 – Alexander 2012-04-24 18:15:21