我可以使用什么而不是itemFromNormalImage:selectedImage:disabledImage:target:selector
它在iOS 7中已被弃用,我不熟悉Objective C中的编程,所以我不知道另一种方式。
答案 0 :(得分:0)
您可以使用this method
+ (id) itemWithNormalImage:(NSString *) value selectedImage:(NSString *) value2 disabledImage:(NSString *) value3 target:(id) r selector:(SEL) s
如果你的代码是这样的话:
CCMenuItemImage *playGameButton = [CCMenuItemImage itemFromNormalImage:@"UIButtonTemplate.png" selectedImage:@"UIButtonTemplate.png" disabledImage:nil target:self selector:@selector(displaySceneSelection)];
现在它应该是这样的:
CCMenuItemImage *playGameButton = [CCMenuItemImage itemWithNormalImage:@"UIButtonTemplate.png" selectedImage:@"UIButtonTemplate.png" disabledImage:nil target:self selector:@selector(displaySceneSelection)];
答案 1 :(得分:0)
试试这个
CCMenuItemSprite *Menu1=[CCMenuItemSprite itemWithNormalSprite:<#(CCNode<CCRGBAProtocol> *)#> selectedSprite:<#(CCNode<CCRGBAProtocol> *)#>];
CCMenuItemSprite *Menu2=[CCMenuItemSprite itemWithNormalSprite:<#(CCNode<CCRGBAProtocol> *)#> selectedSprite:<#(CCNode<CCRGBAProtocol> *)#> block:<#^(id sender)block#>];
CCMenuItemSprite *Menu3=[CCMenuItemSprite itemWithNormalSprite:<#(CCNode<CCRGBAProtocol> *)#> selectedSprite:<#(CCNode<CCRGBAProtocol> *)#> disabledSprite:<#(CCNode<CCRGBAProtocol> *)#> block:<#^(id sender)block#>];
CCMenuItemSprite *Menu4=[CCMenuItemSprite itemWithNormalSprite:<#(CCNode<CCRGBAProtocol> *)#> selectedSprite:<#(CCNode<CCRGBAProtocol> *)#> disabledSprite:<#(CCNode<CCRGBAProtocol> *)#> target:<#(id)#> selector:<#(SEL)#>];
CCMenuItemSprite *Menu5=[CCMenuItemSprite itemWithNormalSprite:<#(CCNode<CCRGBAProtocol> *)#> selectedSprite:<#(CCNode<CCRGBAProtocol> *)#> target:<#(id)#> selector:<#(SEL)#>];