Error on createWithSpriteFrameName

I have created a class called MySprite that inherits from CCSprite and holds three float variables. When I try to use createWithSpriteFrameName

sprite = MySprite::createWithSpriteFrameName("sprite");

I get an error which says

Assigning to 'MySprite *' from incompatible type 'cocos2d::CCObject *'

I have no idea what this means and all help is greatly appreciated!