You can use 'if (CCString *str = dynamic_cast<CCString *>(object))'