2012-04-24 54 views
-2

我得到了類改變超類的屬性值

@interface PlayScene : UIView 

在它的一些特性(這裏是其中的一些)

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

,我得到了一個被稱爲PlayScene

子視圖
@interface gameOverMenu : PlayScene <UITextFieldDelegate> 

我需要得到某種方式在我的子類中的那些屬性。實際上,我需要將它們設置爲等於0,以便「再次播放」按鈕正常工作。

+1

你的意思@interface gameOverMenu:

@interface gameOverMenu : UIView <UITextFieldDelegate> 

他,改成解決它PlayScene ant 2012-04-24 16:14:11

+0

很好啊,我想它應該是這樣的,但我怎樣才能得到屬性?是的,減去我的問題比解釋完全更好...... – Alexander 2012-04-24 16:16:54

+0

那麼當您嘗試訪問來自該'gameOverMenu'子類的實例的屬性時發生了什麼? – 2012-04-24 16:32:26

回答

0

對於那些有同樣的問題,原來的問題是:

@interface GameOverMenu : PlayScene <UITextFieldDelegate> 
+1

請注意,該類應該命名爲'GameOverMenu'。 – bbum 2012-04-24 17:13:06

+0

好吧,我現在遇到了一個新問題,所有屬性都被指定爲「讀寫」,但是當我嘗試像[self figure1] = 0那樣更改它們時;有一個錯誤「分配給'只讀'返回不允許的目標C消息的結果' – Alexander 2012-04-24 17:18:19

+0

@bbum好趕上 – ant 2012-04-24 20:01:08