Using these macros in code can reduce the number of times you press the keyboard and improve the writing efficiency. Nodes related to node Properties
Using these macros in code can reduce the number of times you press the keyboard and improve the writing efficiency. CC_PROPERTY_READONLY cc_property_readty_readonly_pass_by_ref CC_PROPERTY CC_PROPERTY_PASS_BY_REF CC_SYNTHESIZE_READONLY CC_SYNTHESIZE_READONLY_PASS_BY_REF C
Using these macros in code can reduce the number of times you press the keyboard and improve the writing efficiency.
Node attributes
| CC_PROPERTY_READONLY |
| CC_PROPERTY_READONLY_PASS_BY_REF |
| CC_PROPERTY |
| CC_PROPERTY_PASS_BY_REF |
| CC_SYNTHESIZE_READONLY |
| CC_SYNTHESIZE_READONLY_PASS_BY_REF |
| CC_SYNTHESIZE |
| CC_SYNTHESIZE_PASS_BY_REF |
| CC_SYNTHESIZE_RETAIN |
For specific definitions, see CCPlatformMacros. h. These are mainly used to simulate keywords such as @ property, readonly, retain, @ synthesize in objective-C.
Related to namespaces
| NS_CC_BEGIN |
| NS_CC_END |
| USING_NS_CC |
For specific definitions, see CCPlatformMacros. h. Related to the node creation method (node, create)
For specific definitions, see CCPlatformMacros. h. Related to memory management
| CC_SAFE_DELETE |
| CC_SAFE_DELETE_ARRAY |
| CC_SAFE_FREE |
| CC_SAFE_RELEASE |
| CC_SAFE_RELEASE_NULL |
| CC_SAFE_RETAIN |
Logs
| CCLOG |
| CCLOGERROR |
| CCLOGINFO |
| CCLOGWARN |
For specific definitions, see CCPlatformMacros. h. Assertions
| CC_BREAK_IF |
| CC_ASSERT |
| CCAssert |
CC_BREAK_IF is defined in CCPlatformMacros. h and is used for condition judgment in the loop.
CC_BREAK_IF is frequently used in do {} while (0. The function of using statement blocks is quite large. According to GOOGLE's programming specifications, in order to reduce the code hierarchy, the condition judgment should be performed first. If it does not meet the requirements, the subsequent code will be skipped. There are two methods to skip. One is return and the other is break. In the previous method, all subsequent Code cannot be executed; in the latter method, it must be placed in a loop or swich statement block. If do {} while (0) is used, the problem that the Code following the first method cannot be executed can be solved.
CCAssert is defined in ccMacros. h, which encapsulates CC_ASSERT. Related to mathematics
| CCRANDOM_MINUS1_1 |
| CCRANDOM_0_1 |
| CC_DEGREES_TO_RADIANS |
| CC_RADIANS_TO_DEGREES |
For specific definitions, see ccMacros. h. Converts random numbers to radians and degrees.