timer automatically starts while application launch
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.
精彩评论