开发者

timer automatically starts while application launch

开发者 https://www.devze.com 2023-01-14 16:10 出处:网络
hi i ma new to iphone. what i did is crating a timer and calling a function afer 4 sec intervel. (I write code for timer i开发者_StackOverflown viewdidload).Timer will run automatically while applicat

hi i ma new to iphone. what i did is crating a timer and calling a function afer 4 sec intervel. (I write code for timer i开发者_StackOverflown viewdidload).Timer will run automatically while application lunch in simulator it self. But i need the timer will start after first 8 sec and timer will repeat for every 4 sec how can i done this pls help me post some code. thank in advance.


take a variable

BOOL isNotFirstTime;

And in the function that gets triggered after each 4 secs add the following code at the starting

-(void)AfterFourSecondsFuction
{
 if(!isNotFirstTime)
 {
  isNotFirstTime=YES;
  return;
 }
//YOUR CODE HERE...
}

hAPPY cODING...


Use 2 timers. The target of the first 8 second timer can start the second 4 second timer.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号