I’ve discovered what I think is a problem with the CCControlButton implementation. When you try to update the background sprite it dies when attempting to reset the layout. For example:
CCControlButton *button = CCControlButton::create(...); //... CCScale9Sprite *sprite = CCScale9Sprite::create("newBackground.png"); myButton->setBackgroundSpriteForState(sprite, CCControlStateNormal);
^ that causes a crash when CCControlButton::needsLayout() is called. It looks like the member m_backgroundSprite is not getting set as expected, even though this line looks like it’s attempting to do so:
Anybody else having this issue?