tags:

views:

127

answers:

2

Hello,

I am working on a cocos2d iPhone app and want to capture the event after releasing the button press. Will there be any event or notification triggered after releasing the button click. I know when clicking a button we will get notified based on the selector function provided, but after click is finished and releasing the button press, can we get any event notification using any built-in handler? The item being clicked is a MenuItemImage.

Thanks and appreciate if you could share your thoughts on this.

+1  A: 

By button I assume you mean a UIButton.

You listen to the "button release" event with UIControlEventTouchUpInside.

KennyTM
Thank you very much. I use cocos2d project(ParticleTest) -> MenuItemImage *item3 = [MenuItemImage itemFromNormalImage:@"r1.png" selectedImage:@"r2.png" target:self selector:@selector(nextCallback:)];Can i still listen for UIControlEventTouchUpInside in this case too?
cocos2d is completely different from standard Cocoa Touch, and has its own internal architecture. I've edited your question to reflect this.
Brad Larson
I voted down because it cannot be the right answer! the menu items on Cocos2d don't have the same properties and methods of a UIButton.
vfn
A: 

This question makes no sense!

The method that you associate on the selector:@selector(myMethod:) is only triggered after the menu item is released, and by your question it is exactly what you want to achieve.

So, if you are not aware of it, try to log and see when the method is called.

Cheers,
VFN

vfn