【发布时间】:2013-06-20 15:43:28
【问题描述】:
好的,我有 2 节课。
一个包含所有属性,一个包含所有方法。
在我称之为的所有方法的类中。
switch (_allProperties.switchNumber) {
case 0:
CCLOG(@"Saving Info");
CCLOG(@"FirstNumber = %d",numberA);
CCLOG(@"SecondNumber = %d",numberB);
//I get the correct numbers on the dbg
_allProperties.firstNumber = numberA;
_allProperties.secondNumber = numberB;
CCLOG(@"Properties.FirstNumber = %d",_allProperties.firstNumber);
CCLOG(@"Properties.SecondNumber = %d",_allProperties.secondNumber);
//Im getting 0 on both of this logs.
break;
所以,这就是我在 allMethods 类上调用 _allProperties 的方式
@property (strong) PropertiesClass *allProperties;
下面是 .FirstNumber && .SecondNumber 如何在 PropertiesClass 上强制转换
@property (nonatomic, assign) int firstNumber;
@property (nonatomic,assign) int secondNumber;
我错过了什么?为什么属性没有获得价值??
感谢您的宝贵时间,祝大家有美好的一天!
【问题讨论】:
标签: cocoa-touch cocos2d-iphone xcode4.5