title: touch event is not detected on Touching sprite in Cocos2dx
body: <p>I'm trying to obtain touch event on touching the sprite, I have been through many links and tutorials but its not working. 'm using Xcode IDE and Cocos2dx 2.1.4.
  this is the method there touch event should be obtained ideally in cpp file.</p>
  
  <pre><code>bool ccTouchBegan(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent){
  
  }
  </code></pre>
  
  <p>I am trying to implement touch event on a sprite. i have created sprite like this :</p>
  
  <pre><code>    CCSize size = CCDirector::sharedDirector()-&gt;getWinSize();
      CCSprite *backGroundSprint = CCSprite::create("bg.jpg");
      CCSize imageSize = backGroundSprint-&gt;getContentSize();
      backGroundSprint-&gt;setScaleX(size.width/imageSize.width);
      backGroundSprint-&gt;setScaleY(size.width/imageSize.height);
      backGroundSprint-&gt;setAnchorPoint(ccp(0, 0));
      this-&gt;addChild(backGroundSprint,0);
  </code></pre>
  
  <p>i also enabled touch by doing this : </p>
  
  <pre><code>this-&gt;setTouchEnabled(true);
  </code></pre>
  
  <p>in </p>
  
  <pre><code>bool HelloWorld::init(){
  </code></pre>
  
  <p>and in my .h file i have this </p>
  
  <p>public:</p>
  
  <pre><code>virtual void onEnter();
  virtual void onExit();
  virtual bool ccTouchBegan(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
  virtual void ccTouchMoved(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
  virtual void ccTouchEnded(cocos2d::CCTouch *pTouch, cocos2d::CCEvent *pEvent);
  </code></pre>