So here's the deal. I have an NSTimer set up to fire an event when the given time elapses. This timer is reset, and the time interval changed, a few times. EDIT: This code is inside the changeText method. When I ran it on my iPhone, it practically skipped over the third string in the array. I should add that by the time the OS gets to executing the relevant code, it does not change the time interval on the timer. However, I just enclosed the second line in another if() block so the phone will to see if resetting the timer is necessary. I'll see if that solves my problem.
Because I don't want to accidentally give too many details, I will only include a small portion of the app's code. I've also taken out anything that might reveal what I'm working on.
Because I don't want to accidentally give too many details, I will only include a small portion of the app's code. I've also taken out anything that might reveal what I'm working on.
Code:
if (thecount >= 12 & thecount <= 16)
{
myTimer = [NSTimer scheduledTimerWithTimeInterval:7 target:self selector:@selector(changeText:) userInfo:nil repeats:YES];
NSArray *atSentenceArray = // array of strings
self.myLabel.text = [atSentenceArray objectAtIndex:(thecount - 12)];
}
Last edited: