CCLOG("observerName: %s", observer->getName());
if (!strcmp(name,observer->getName()))
observer->performSelector(object);
}
}
observer->getName() always gives an empty string. When I went through the constructor of CCNotificationObserver in m_name it places a garbage value and I believe this bug was reported and one forgot to fix it
When you postnotification by using the method below
void CCNotificationCenter::postNotification(const char name, CCObject *object) { CCObject obj = NULL; CCARRAY_FOREACH(m_observers, obj) { CCNotificationObserver* observer = (CCNotificationObserver*) obj; if (!observer) continue;
}
observer->getName() always gives an empty string. When I went through the constructor of CCNotificationObserver in m_name it places a garbage value and I believe this bug was reported and one forgot to fix it
CCNotificationObserver::CCNotificationObserver(CCObject target, SEL_CallFuncO selector, const char name, CCObject *obj) { m_target = target; m_selector = selector; m_object = obj;
//bug fix me orig.copy(m_name,strlen(name),0); }