Need help in the memory game
Hi all, can anyone guide me on how to stop a method when it is being called by using: [self performerSelector: withObject: afterDelay:];
as my selector method is doing: button.highlighed = !button.highlighted;
it seems to be repeating itself and "blinks" together with other buttons.
Thanks for any help or advice. =)
as my selector method is doing: button.highlighed = !button.highlighted;
it seems to be repeating itself and "blinks" together with other buttons.
Thanks for any help or advice. =)
If you don't want it to happen more than once, don't tell it to happen more than once?
haha.. I know.. but I do not know how to ask him not to repeat. lol
It doesn't repeat. Just don't do it more than once.
but my current code doesn't make it perform more than once.
if (d == one){
[self performSelector:@selector(delayEventRED) withObject:red afterDelay:1.0f];
[self performSelector:@selector(delayEventGREEN) withObject:green afterDelay:3.0f];
[self performSelector:@selector(delayEventYELLOW) withObject:yellow afterDelay:5.0f];
[self performSelector:@selector(delayEventBLUE) withObject:blue afterDelay:7.0f];
}
currently is like that.
if (d == one){
[self performSelector:@selector(delayEventRED) withObject:red afterDelay:1.0f];
[self performSelector:@selector(delayEventGREEN) withObject:green afterDelay:3.0f];
[self performSelector:@selector(delayEventYELLOW) withObject:yellow afterDelay:5.0f];
[self performSelector:@selector(delayEventBLUE) withObject:blue afterDelay:7.0f];
}
currently is like that.
I find it odd that you are passing arguments to selectors which don't take arguments, but that's beside the point.
perhaps the method that contains this code is called more than once.
perhaps the method that contains this code is called more than once.
the code behind the method is only:
red.highlighted = !red.highlighted;
and so on.
red.highlighted = !red.highlighted;
and so on.
thx alot. I got what I want already =)
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
User input for memory game | soulesstps | 0 | 4,096 |
Jan 2, 2011 09:37 PM Last Post: soulesstps |
|
Need help in creating a memory game(2) | soulesstps | 9 | 11,614 |
Dec 13, 2010 07:44 PM Last Post: soulesstps |
|
Need help in creating a memory game | soulesstps | 12 | 12,422 |
Dec 4, 2010 11:58 AM Last Post: shazi |