#define CC_PROPERTY(varType, varName, funName) protected: varType varName; public: virtual varType get##funName(void); public: virtual void set##funName(varType var); 解释: CC_SYNTHESIZE(int, nTest, Test) 相当于干了下面这些事: protected: int nTest; public: virtual nTest getTest(void) const { return nTest; } public: virtual void setTest(int var){ nTest = var; }