문제

Let us say I have a void function which just have NSLog(@"Call me"); in its body.

How can I call it in my view like in every ten seconds. I know it sounds like very beginner question but I really need it

도움이 되었습니까?

해결책

NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(yourMethod) userInfo:nil repeats:YES];

다른 팁

Use NSTimer class [NSTimer scheduledTimerWithTimeInterval:10.0 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:YES]

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top