Game Development Reference
In-Depth Information
Subclassing CCSprite for Sprite CCB Classes
This particular error message may occur when launching the app or loading a scene:
reason: '[<NameOfClass 0x7a043520>
setValue:forUndefinedKey:]: this class is not key value
coding-compliant for the key spriteFrame.'
It indicates that you created a CCB of type sprite and assigned a custom class to it.
However, the custom class does not subclass CCSprite but some other class, most
likely CCNode . Changing the custom class' superclass to CCSprite will fix this error.
Can't Edit the Custom Class Field
You have a Sub File ( CCBFile ) node selected. In that case, the Custom class field is
grayed out and can't be edited. The custom class needs to be edited in the referenced CCB
file.
Can't Add Custom Properties to a Node
In order for a node to have custom properties, it has to have the Custom Class field as-
signed on the Item Code Connections tab. That custom class needs to have properties or
ivars matching the custom properties' names.
Physics Collisions Are Not Working as Expected
If two nodes are colliding but shouldn't be or they don't collide but should, here are a few
things to check:
The categories and masks of the two bodies involved must match. If both
should collide, the category of one should be in the mask of the other, and
vice versa.
Keep in mind that empty category and mask fields means “match all categor-
ies/masks, which is the exact opposite of what you would expect from an
empty field.
Search WWH ::




Custom Search