CCMenuItem *starMenuItem = [CCMenuItemImage itemFromNormalImage:@"ButtonStar.png"selectedImage:@"ButtonStarSel.png" 
target:self selector:@selector(starButtonTapped:)];请问itemFromNormalImage函数中 target:self 和 selector:@selector(starButtonTapped:)两个参数改写成c++怎~~ 尤其是selector选择器~ 请详细解答 谢谢~~  

解决方案 »

  1.   

    SEL类型是object-c特有的类型,C++不支持。只能用object-c
      

  2.   

    回答楼上 SEL类型不能用我知道 但是应该可以用c++的的方法写出来
    这样写:
    CCMenuItem *starMenuItem = CCMenuItemImage::itemFromNormalImage("ButtonStar.png", ButtonStarSel.png", target:self, selector:@selector(starButtonTapped:));
    target:self我暂时用的this代替
    selector:@selector(starButtonTapped:) 怎么写呢~~  
    注释:starButtonTapped:是一个函数starButtonTapped(NULL)暂时赋空值吧~  
      

  3.   

    MFC也有按钮action关联的函数的记不清了 比如onClick神马的
      

  4.   

    c++转obj-c比较容易,lz转回去干嘛啊?
      

  5.   

    公司用的objective-v写的游戏 需要跨平台到安卓系统上 所以要用C++重写~~~