Does somebody can help me to figure out the plug register
The Pluginx ios demo work well. But When I want to use it in my ios cocos2dx project with pluginx. I add the PlugUmeng, PlugFlurry and PluginProtocal xcodeproject and compile well, but when I run the
bool AppDelegate::applicationDidFinishLaunching()
{
loadAnalyticsPlugin();
I meet the problem.
pPlugin will be NULL pointer after the below sentence. After I debug I found
id obj = [[NSClassFromString(className) alloc] init];
if (obj nil) break;
the obj was NULL pointer
if (kLanguageChinese langType)
{
pPlugin = PluginManager::getInstance()->loadPlugin(“AnalyticsUmeng”);
s_strAppKey = umengKey;
}
else
{
pPlugin = PluginManager::getInstance()->loadPlugin(“AnalyticsFlurry”);
s_strAppKey = flurryKey;
}
PluginFactory::getInstance()->createPlugin(name);
/* create the plugin by name/
PluginProtocol* PluginFactory::createPlugin(const char* name)
{
PluginProtocol* pRet = NULL;
do
{
if (name NULL || strlen(name) 0) break;
NSString* className = [NSString stringWithUTF8String:name];
id obj = [[NSClassFromString(className) alloc] init];
if (obj == nil) break;
if ([obj conformsToProtocol:protocol(InterfaceAds)]) { pRet = new ProtocolAds(); } else if ([obj conformsToProtocol:
protocol(InterfaceAnalytics)]) {
pRet = new ProtocolAnalytics();
} else
if ([obj conformsToProtocol:protocol(InterfaceIAP)]) { pRet = new ProtocolIAP(); } else if ([obj conformsToProtocol:
protocol(InterfaceSocial)]) {
pRet = new ProtocolSocial();