UIScrollView 无法响应Touch事件

UIScrollView->setTouchEnabled(true);

已经设置,为什么ccTouchesBegan的方法里进不去呢?

什么版本呢?新版换事件管理方式了。另检查下是否事件被其他控件接收。

这是以前的:
void StrengthenChoice::ccTouchesBegan(CCSet *pTouches, CCEvent *pEvent) {

//点击获取坐标
int tag;
CCSetIterator it=pTouches->begin();
CCTouch* touch=(CCTouch*)(*it);
CCPoint touchPoint = touch->getLocationInView();
touchPoint = CCDirector::sharedDirector()->convertToGL( touchPoint ); 

这是现在的:
void Preview::test(CCObject* pSender,TouchEventType type)
{
if(type == TOUCH_EVENT_BEGAN)
{
CCLog("!!!");
}

}

问题是现在要怎么实现以前那样的效果,知道Touch的点。

将sender转换成widget,然后使用widget->gettouchMovePos()获取point

将sender转换成widget

不明白是什么意思?

void Preview::test(CCObject* pSender,TouchEventType type)

sender是参数传带的这个psender,这个sender就是被触摸的对象,这个对象用了一个属性来记录触摸的点。

先类型转换:
Widget * pWidgetTouchPoint = (Widget *)pSender;
pWidgetTouchPoint->getTouchMovePos();

是这样的吗?

yes,返回的是一个point类型。

Widget * pWidgetTouchPoint = (Widget *)pSender;
CCPoint touchPoint = pWidgetTouchPoint->getTouchMovePos();
CCLog("%f",touchPoint.x);
能打出来了。