title: Cocos2dx RegisterTouchDispatcher
body: <p>I have started using cocos2d-x in iphone. I have created a class which inherits from cclayer. Now when I try to register it with touch dispatcher it crashes.</p>
  
  <p>In .h file:</p>
  
  <p>class BasePage : public cocos2d::CCLayer</p>
  
  <p>And .m file:</p>
  
  <pre><code>CCDirector::sharedDirector()-&gt;getTouchDispatcher()-&gt;addTargetedDelegate(this, INT_MIN + 1, true);
  </code></pre>
  
  <p>And it crashes in ccobject.m file:</p>
  
  <pre><code>void CCObject::retain(void)
  {
      CCAssert(m_uReference &gt; 0, "reference count should greater than 0");[here is crash]
  
      ++m_uReference;
  }
  </code></pre>
  
  <p>Can you please give me some solution?</p>