-1

I would like to create an NSTimer object in a callback event (scroll view i would like to develop a facebook or reeder like refresh, if they are holding some time the scroll view at the end)

I have realized if i am creating a time, in the event the the timer is getting nill imideaty:

backTimer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(backButton) userInfo:nil repeats:NO];
NSLog(@"backtimer : %@ ", backTimer.timeInterval);

2011-12-12 14:42:57.733 BabyTapBook[16825:13103] backtimer : (null)

So I am searching the proper way to do this functionality

Visky Máté
  • 203
  • 3
  • 8
  • Did you mean to log with the `timeInterval` property with a `%@`. Shouldn't it be `%lf` since its a `NSTimeInterval/double` type? – axiixc Dec 13 '11 at 00:25

1 Answers1

0
const int kYourTimeInterval = 1; // the time in seconds - the interval at which your method is called

aTimer = [NSTimer scheduledTimerWithTimeInterval:kYourTimeInterval target:self selector:@selector(youMethodHere) userInfo:nil repeats:YES];

To terminate it, use [aTimer invalidate];

Dani Pralea
  • 4,545
  • 2
  • 31
  • 49
  • scheduledTimerWithTimeInterval is not working either. If it is in a callback block like: scrollViewDidScroll: block, it is not working:(. I dont understand why not:( – Visky Máté Dec 12 '11 at 16:59