Need help in the memory game

Apprentice
Posts: 16
Joined: 2010.12
Post: #1
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. =)
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
If you don't want it to happen more than once, don't tell it to happen more than once?
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2010.12
Post: #3
haha.. I know.. but I do not know how to ask him not to repeat. lol
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
It doesn't repeat. Just don't do it more than once.
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2010.12
Post: #5
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.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
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.
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2010.12
Post: #7
the code behind the method is only:

red.highlighted = !red.highlighted;


and so on.
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2010.12
Post: #8
thx alot. I got what I want already =)
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  User input for memory game soulesstps 0 2,795 Jan 2, 2011 09:37 PM
Last Post: soulesstps
  Need help in creating a memory game(2) soulesstps 9 6,832 Dec 13, 2010 07:44 PM
Last Post: soulesstps
  Need help in creating a memory game soulesstps 12 8,581 Dec 4, 2010 11:58 AM
Last Post: shazi