0

How can I make a timer that change the properties of a UIButton from hidden to show, and from show to hidden alternating between 4 buttons?

I'm using xCode 4.4

Thanks!

Pablo
  • 21
  • 4
  • [What have you tried?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Dan F Jul 31 '12 at 18:00
  • I don't know exactly what to do, but I've tried to use a timer inside a touch down event, but even if this is right, I don't know how to change the properties by codes. – Pablo Jul 31 '12 at 18:09
  • timer: http://stackoverflow.com/questions/3519562/how-do-i-write-a-timer-in-objective-c show/hide: http://stackoverflow.com/questions/957821/show-or-hide-a-uibutton-in-iphone-app-with-obejctive-c – Zac Jul 31 '12 at 18:15

1 Answers1

0

 NSTimer *aTimer = [NSTimer scheduledTimerWithTimeInterval: 2.0
                      target: self
                      selector:@selector(onTick:)
                      userInfo: nil repeats:YES];

And, onTick method should look like this

-(void)onTick:(NSTimer *)timer {
   //This is where you need to set your button hidden property.
}

Check this link out.It's well detailed.

Community
  • 1
  • 1
limon
  • 3,222
  • 5
  • 35
  • 52