2012-04-24 55 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